diff options
-rw-r--r-- | doc/s6-log.html | 13 | ||||
-rw-r--r-- | src/daemontools-extras/s6-log.c | 17 |
2 files changed, 7 insertions, 23 deletions
diff --git a/doc/s6-log.html b/doc/s6-log.html index d1ee3ae..7f461bc 100644 --- a/doc/s6-log.html +++ b/doc/s6-log.html @@ -27,7 +27,7 @@ with full POSIX regular expression support. <h2> Interface </h2> <pre> - s6-log [ -d <em>notif</em> ] [ -q | -v ] [ -b ] [ -p ] [ -t ] [ -e ] [ -l <em>linelimit</em> ] <em>logging script</em> + s6-log [ -d <em>notif</em> ] [ -q | -v ] [ -b ] [ -p ] [ -l <em>linelimit</em> ] <em>logging script</em> </pre> <p> @@ -60,12 +60,6 @@ write to a slow file system. </li> SIGTERM; only exit on a SIGHUP or when reading EOF on stdin. This is useful for a logger that you really do not want to lose even if automated administration (e.g. the downing of a supervision tree) would kill it. </li> - <li> <tt>-t</tt> : timestamp. Prepends every log line that is written to -a logging directory with a -<a href="//skarnet.org/software/skalibs/libstddjb/tai.html">TAI64N</a> -timestamp. <strong>This option is now deprecated.</strong> </li> - <li> <tt>-e</tt> : timestamp alerts. Prepends every "alert" line with a -TAI64N timestamp. <strong>This option is now deprecated. </strong> </li> <li> <tt>-q | -v</tt> : quiet | verbose. Decreases | increases s6-log's verbosity, i.e. which messages are sent to stderr. The default verbosity is 1. Currently supported verbosity levels: @@ -275,10 +269,9 @@ selected lines. </p> <ul> - <li> <strong>2</strong> or <strong>e</strong>: alert. s6-log will print "s6-log: alert: ", + <li> <strong>2</strong>: alert. s6-log will print "s6-log: alert: ", possibly prepended with a timestamp, followed by the first -<em>alertsize</em> bytes of the line, to its standard error. -<strong>The <tt>e</tt> form is deprecated.</strong> </li> +<em>alertsize</em> bytes of the line, to its standard error. </li> <li> <strong>1</strong>: forward to stdout. s6-log will print the selected line to its stdout. If any error occurs, e.g. if stdout was a pipe and the reading end closed, this directive will be ignored for the rest of diff --git a/src/daemontools-extras/s6-log.c b/src/daemontools-extras/s6-log.c index 5128751..52aef13 100644 --- a/src/daemontools-extras/s6-log.c +++ b/src/daemontools-extras/s6-log.c @@ -40,7 +40,7 @@ #include <execline/config.h> #endif -#define USAGE "s6-log [ -d notif ] [ -q | -v ] [ -b ] [ -p ] [ -t ] [ -e ] [ -l linelimit ] logging_script" +#define USAGE "s6-log [ -d notif ] [ -q | -v ] [ -b ] [ -p ] [ -l linelimit ] logging_script" #define dieusage() strerr_dieusage(100, USAGE) #define dienomem() strerr_diefu1sys(111, "stralloc_catb") @@ -735,8 +735,6 @@ static inline void script_firstpass (char const *const *argv, unsigned int *sell if ((*argv)[1]) goto fail ; gf |= 2 ; break ; - case 'e' : - if (verbosity) strerr_warnw1x("directive e is deprecated, use 2 instead") ; case '1' : case '2' : if ((*argv)[1]) goto fail ; @@ -773,7 +771,7 @@ static inline void script_firstpass (char const *const *argv, unsigned int *sell strerr_dief2x(100, "syntax error at directive: ", *argv) ; } -static inline void script_secondpass (char const *const *argv, scriptelem_t *script, sel_t *selections, act_t *actions, unsigned int compat_gflags) +static inline void script_secondpass (char const *const *argv, scriptelem_t *script, sel_t *selections, act_t *actions) { tain_t retrytto ; unsigned int fd2_size = 200 ; @@ -871,11 +869,9 @@ static inline void script_secondpass (char const *const *argv, scriptelem_t *scr actions[act++] = a ; flagacted = 1 ; flags = 0 ; break ; } - case 'e' : case '2' : { act_t a = { .type = ACTTYPE_FD2, .flags = flags, .data = { .fd2_size = fd2_size } } ; - if (compat_gflags & 2) a.flags |= 1 ; actions[act++] = a ; flagacted = 1 ; flags = 0 ; break ; } @@ -889,7 +885,6 @@ static inline void script_secondpass (char const *const *argv, scriptelem_t *scr case '/' : { act_t a = { .type = ACTTYPE_DIR, .flags = flags, .data = { .ld = lidx } } ; - if (compat_gflags & 1) a.flags |= 1 ; logdir_init(lidx, s, n, tolerance, maxdirsize, &retrytto, processor, *argv, flags) ; lidx++ ; actions[act++] = a ; flagacted = 1 ; flags = 0 ; @@ -1171,14 +1166,13 @@ int main (int argc, char const *const *argv) unsigned int linelimit = 8192 ; unsigned int notif = 0 ; unsigned int gflags = 0 ; - unsigned int compat_gflags = 0 ; int flagblock = 0 ; PROG = "s6-log" ; { subgetopt_t l = SUBGETOPT_ZERO ; for (;;) { - int opt = subgetopt_r(argc, argv, "qvbptel:d:", &l) ; + int opt = subgetopt_r(argc, argv, "qvbpl:d:", &l) ; if (opt == -1) break ; switch (opt) { @@ -1186,8 +1180,6 @@ int main (int argc, char const *const *argv) case 'v' : verbosity++ ; break ; case 'b' : flagblock = 1 ; break ; case 'p' : flagprotect = 1 ; break ; - case 't' : gflags |= 1 ; compat_gflags |= 1 ; break ; - case 'e' : gflags |= 1 ; compat_gflags |= 2 ; break ; case 'l' : if (!uint0_scan(l.arg, &linelimit)) dieusage() ; break ; case 'd' : if (!uint0_scan(l.arg, ¬if)) dieusage() ; @@ -1201,7 +1193,6 @@ int main (int argc, char const *const *argv) } if (!argc) dieusage() ; if (linelimit && linelimit < LINELIMIT_MIN) linelimit = LINELIMIT_MIN ; - if (compat_gflags && verbosity) strerr_warnw1x("options -t and -e are deprecated") ; if (!fd_sanitize()) strerr_diefu1sys(111, "ensure stdin/stdout/stderr are open") ; if (!tain_now_set_stopwatch_g() && verbosity) strerr_warnwu1sys("set monotonic clock and read current time - timestamps may be wrong for a while") ; @@ -1215,7 +1206,7 @@ int main (int argc, char const *const *argv) logdir_t logdirblob[llen] ; iopause_fd x[3 + llen] ; logdirs = logdirblob ; - script_secondpass(argv, script, selections, actions, compat_gflags) ; + script_secondpass(argv, script, selections, actions) ; x[0].fd = selfpipe_init() ; if (x[0].fd < 0) strerr_diefu1sys(111, "selfpipe_init") ; if (sig_ignore(SIGPIPE) < 0) strerr_diefu1sys(111, "sig_ignore(SIGPIPE)") ; |