add LOG_PERROR flag
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Thu, 16 Feb 1989 04:21:59 +0000 (20:21 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Thu, 16 Feb 1989 04:21:59 +0000 (20:21 -0800)
SCCS-vsn: usr.bin/logger/logger.1 6.4
SCCS-vsn: usr.bin/logger/logger.c 6.11

usr/src/usr.bin/logger/logger.1
usr/src/usr.bin/logger/logger.c

index ad95d6d..d14d4c8 100644 (file)
@@ -13,7 +13,7 @@
 .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 .\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 .\"
 .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 .\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 .\"
-.\"    @(#)logger.1    6.3 (Berkeley) %G%
+.\"    @(#)logger.1    6.4 (Berkeley) %G%
 .\"
 .TH LOGGER 1 ""
 .UC 6
 .\"
 .TH LOGGER 1 ""
 .UC 6
@@ -22,51 +22,49 @@ logger \- make entries in the system log
 .SH SYNOPSIS
 .B logger
 [
 .SH SYNOPSIS
 .B logger
 [
-.B \-t
-tag
-] [
-.B \-p
-pri
-] [
-.B \-i
+.B \-is
 ] [
 .B \-f
 file
 ] [
 ] [
 .B \-f
 file
 ] [
-message ...
-]
+.B \-p
+pri
+] [
+.B \-t
+tag ] [ message ... ]
 .SH ARGUMENTS
 .TP 12n
 .SH ARGUMENTS
 .TP 12n
-.BI \-t \ tag
-Mark every line in the log with the specified
-.IR tag .
+.B \-i
+Log the process id of the logger process
+with each line.
+.TP
+.B \-s
+Log the message to standard error, as well as the system log.
+.TP
+.BI \-f \ file
+Log the specified file.
 .TP
 .BI \-p \ pri
 Enter the message with the specified priority.
 .TP
 .BI \-p \ pri
 Enter the message with the specified priority.
-The priority may be specified numerically
-or as a ``facility.level''
+The priority may be specified numerically or as a ``facility.level''
 pair.
 pair.
-For example, ``\-p local3.info''
-logs the message(s) as
+For example, ``\-p local3.info'' logs the message(s) as
 .IR info rmational
 level in the
 .I local3
 facility.
 The default is ``user.notice.''
 .TP
 .IR info rmational
 level in the
 .I local3
 facility.
 The default is ``user.notice.''
 .TP
-.B \-i
-Log the process id of the logger process
-with each line.
-.TP
-.BI \-f \ file
-Log the specified file.
+.BI \-t \ tag
+Mark every line in the log with the specified
+.IR tag .
 .TP
 message
 The message to log; if not specified, and the \fB-f\fP flag is not
 provided, standard input is logged.
 .SH DESCRIPTION
 .I Logger
 .TP
 message
 The message to log; if not specified, and the \fB-f\fP flag is not
 provided, standard input is logged.
 .SH DESCRIPTION
 .I Logger
-provides a program interface to the
+provides a shell command interface to the
 .IR syslog (3)
 system log module.
 .SH EXAMPLES
 .IR syslog (3)
 system log module.
 .SH EXAMPLES
@@ -74,5 +72,4 @@ logger System rebooted
 .PP
 logger \-p local0.notice \-t HOSTIDM \-f /dev/idmc
 .SH SEE ALSO
 .PP
 logger \-p local0.notice \-t HOSTIDM \-f /dev/idmc
 .SH SEE ALSO
-syslog(3),
-syslogd(8)
+syslog(3), syslogd(8)
index a21635d..54845b4 100644 (file)
@@ -22,7 +22,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)logger.c   6.10 (Berkeley) %G%";
+static char sccsid[] = "@(#)logger.c   6.11 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <stdio.h>
 #endif /* not lint */
 
 #include <stdio.h>
@@ -47,7 +47,7 @@ main(argc, argv)
        char *tag, buf[1024], *getlogin();
 
        tag = NULL;
        char *tag, buf[1024], *getlogin();
 
        tag = NULL;
-       while ((ch = getopt(argc, argv, "f:ip:t:")) != EOF)
+       while ((ch = getopt(argc, argv, "f:ip:st:")) != EOF)
                switch((char)ch) {
                case 'f':               /* file to log */
                        if (freopen(optarg, "r", stdin) == NULL) {
                switch((char)ch) {
                case 'f':               /* file to log */
                        if (freopen(optarg, "r", stdin) == NULL) {
@@ -62,6 +62,9 @@ main(argc, argv)
                case 'p':               /* priority */
                        pri = pencode(optarg);
                        break;
                case 'p':               /* priority */
                        pri = pencode(optarg);
                        break;
+               case 's':               /* log to standard error */
+                       logflags |= LOG_PERROR;
+                       break;
                case 't':               /* tag */
                        tag = optarg;
                        break;
                case 't':               /* tag */
                        tag = optarg;
                        break;