diff options
author | Eric Andersen | 2004-06-22 10:12:59 +0000 |
---|---|---|
committer | Eric Andersen | 2004-06-22 10:12:59 +0000 |
commit | 7f94a5caa251d3d539bbcf75eb97f11824c577ee (patch) | |
tree | 022e330b0f343f7745f7e1a757dc514e33be0072 /sysklogd/syslogd.c | |
parent | 36adca81f54d9479a440865acd29fc2fbcfbaf1d (diff) | |
download | busybox-7f94a5caa251d3d539bbcf75eb97f11824c577ee.zip busybox-7f94a5caa251d3d539bbcf75eb97f11824c577ee.tar.gz |
Patch from Bastian Blank:
Hi folks
The following patch adds a new log message output to syslogd. This
output omits hostname and priority and is used in d-i to make the syslog
output better readable without lossing information.
Bastian
I am applying this since I have syslogd hacked up in my wife's
access point with the same format string.... Might as well make
this hack official.
-Erik
Diffstat (limited to 'sysklogd/syslogd.c')
-rw-r--r-- | sysklogd/syslogd.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 49deab2..8845bb4 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c @@ -35,6 +35,7 @@ #include <paths.h> #include <signal.h> #include <stdarg.h> +#include <stdbool.h> #include <time.h> #include <string.h> #include <unistd.h> @@ -88,6 +89,9 @@ static int doRemoteLog = FALSE; static int local_logging = FALSE; #endif +/* Make loging output smaller. */ +static bool small = false; + #define MAXLINE 1024 /* maximum line length */ @@ -428,8 +432,13 @@ static void logMessage(int pri, char *msg) } if (local_logging == TRUE) #endif + { /* now spew out the message to wherever it is supposed to go */ - message("%s %s %s %s\n", timestamp, LocalHostName, res, msg); + if (small) + message("%s %s\n", timestamp, msg); + else + message("%s %s %s %s\n", timestamp, LocalHostName, res, msg); + } } static void quit_signal(int sig) @@ -666,6 +675,9 @@ extern int syslogd_main(int argc, char **argv) circular_logging = TRUE; break; #endif + case 'S': + small = true; + break; default: bb_show_usage(); } |