[BusyBox-cvs] CVS update of busybox/sysklogd (syslogd.c)

Erik Andersen andersen at codepoet.org
Tue Jun 22 10:12:59 UTC 2004


    Date: Tuesday, June 22, 2004 @ 04:12:59
  Author: andersen
    Path: /var/cvs/busybox/sysklogd

Modified: syslogd.c (1.109 -> 1.110)

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


Index: busybox/sysklogd/syslogd.c
diff -u busybox/sysklogd/syslogd.c:1.109 busybox/sysklogd/syslogd.c:1.110
--- busybox/sysklogd/syslogd.c:1.109	Wed Apr 14 11:51:36 2004
+++ busybox/sysklogd/syslogd.c	Tue Jun 22 04:12:59 2004
@@ -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 local_logging = FALSE;
 #endif
 
+/* Make loging output smaller. */
+static bool small = false;
+
 
 #define MAXLINE         1024	/* maximum line length */
 
@@ -428,8 +432,13 @@
 	}
 	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 @@
 			circular_logging = TRUE;
 			break;
 #endif
+		case 'S':
+			small = true;
+			break;
 		default:
 			bb_show_usage();
 		}



More information about the busybox-cvs mailing list