#! /bin/sh

# write to stderr and the system log for systems such as SunOS that
# have `logger` without -s

# --S-LICENSE--
#	$Revision: 1.9 $

exec 1>&2

USAGE="`basename $0`: [-x] [-p log_facility] [-t tag] message"
LOGGER_FACILITY=
TAG=DCC
while getopts "xp:t:" c; do
    case $c in
	x) set -x; DEBUG=yes;;
	p) LOGGER_FACILITY="-p $OPTARG";;
	t) TAG="$OPTARG";;
	*) echo "$USAGE" 1>&2
	    logger $LOGGER_FACILITY -t "$TAG" "$USAGE"
	    ;;
    esac
done
shift `expr $OPTIND - 1 || true`

echo "$*"
logger $LOGGER_FACILITY -t "$TAG" "$*"
