From 40f3fa5f114a3ec80ef1a0cf0b89d844f360253a Mon Sep 17 00:00:00 2001
From: Laurent Bercot
Date: Sun, 3 Jan 2021 22:03:04 +0000
Subject: Remove deprecated options/directives from s6-log
---
doc/s6-log.html | 13 +++----------
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.
Interface
- s6-log [ -d notif ] [ -q | -v ] [ -b ] [ -p ] [ -t ] [ -e ] [ -l linelimit ] logging script
+ s6-log [ -d notif ] [ -q | -v ] [ -b ] [ -p ] [ -l linelimit ] logging script
@@ -60,12 +60,6 @@ write to a slow file system.
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.
-
-t : timestamp. Prepends every log line that is written to
-a logging directory with a
-TAI64N
-timestamp. This option is now deprecated.
- -e : timestamp alerts. Prepends every "alert" line with a
-TAI64N timestamp. This option is now deprecated.
-q | -v : 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.
- - 2 or e: alert. s6-log will print "s6-log: alert: ",
+
- 2: alert. s6-log will print "s6-log: alert: ",
possibly prepended with a timestamp, followed by the first
-alertsize bytes of the line, to its standard error.
-The e form is deprecated.
+alertsize bytes of the line, to its standard error.
- 1: 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
#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)") ;
--
cgit v1.2.3