path: root/src/pies.h
authorSergey Poznyakoff <>2016-02-18 06:12:39 (GMT)
committer Sergey Poznyakoff <>2016-02-18 06:17:35 (GMT)
commitd5302613a00915076b945b25b50eb6b376121955 (patch) (side-by-side diff)
tree58c8ba0120c52632f008dff191532afc8decaf79 /src/pies.h
parente430f586ccf6621136089fb1d9d865ce1a351360 (diff)
Improve logging
* src/diag.c: Rewrite. (vdiagmsg,diagmsg): New functions. * src/pies.c (main): Set DIAG_REOPEN_LOG for init process. * src/pies.h (DIAG_REOPEN_LOG): New flag (DIAG_TO_MASK,DIAG_ALL): New constants. (diagmsg): New proto. * src/sysvinit.c: Add log messages in important transition points (inittrans): Reinitialize logging to syslog upon transition to normal mode.
Diffstat (limited to 'src/pies.h') (more/less context) (ignore whitespace changes)
1 files changed, 9 insertions, 2 deletions
diff --git a/src/pies.h b/src/pies.h
index 4a6160f..9a3dfca 100644
--- a/src/pies.h
+++ b/src/pies.h
@@ -446,8 +446,12 @@ int meta1parse (void);
/* diag.c */
-#define DIAG_TO_SYSLOG 0x1
-#define DIAG_TO_STDERR 0x2
+#define DIAG_TO_SYSLOG 0x01
+#define DIAG_TO_STDERR 0x02
+#define DIAG_TO_MASK 0x0f
+#define DIAG_REOPEN_LOG 0x10
extern int diag_output;
@@ -463,6 +467,9 @@ void diag_setup (int flags);
# define PIES_PRINTFLIKE(fmt,narg) __attribute__ ((__format__ (__printf__, fmt, narg)))
+void diagmsg (int logf, int prio, const char *fmt, ...)
void logmsg (int prio, const char *fmt, ...) PIES_PRINTFLIKE(2,3);
void logmsg_printf (int prio, const char *fmt, ...) PIES_PRINTFLIKE(2,3);
void logmsg_vprintf (int prio, const char *fmt, va_list ap);

Return to:

Send suggestions and report system problems to the System administrator.