aboutsummaryrefslogtreecommitdiff
path: root/src/pies.h
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2016-02-18 08:12:39 +0200
committerSergey Poznyakoff <gray@gnu.org>2016-02-18 08:17:35 +0200
commitd5302613a00915076b945b25b50eb6b376121955 (patch)
tree58c8ba0120c52632f008dff191532afc8decaf79 /src/pies.h
parente430f586ccf6621136089fb1d9d865ce1a351360 (diff)
downloadpies-d5302613a00915076b945b25b50eb6b376121955.tar.gz
pies-d5302613a00915076b945b25b50eb6b376121955.tar.bz2
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')
-rw-r--r--src/pies.h11
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);
446 446
447 447
448/* diag.c */ 448/* diag.c */
449#define DIAG_TO_SYSLOG 0x1 449#define DIAG_TO_SYSLOG 0x01
450#define DIAG_TO_STDERR 0x2 450#define DIAG_TO_STDERR 0x02
451#define DIAG_TO_MASK 0x0f
452#define DIAG_REOPEN_LOG 0x10
453
454#define DIAG_ALL (DIAG_REOPEN_LOG|DIAG_TO_STDERR|DIAG_TO_SYSLOG)
451 455
452extern int diag_output; 456extern int diag_output;
453 457
@@ -463,6 +467,9 @@ void diag_setup (int flags);
463# define PIES_PRINTFLIKE(fmt,narg) __attribute__ ((__format__ (__printf__, fmt, narg))) 467# define PIES_PRINTFLIKE(fmt,narg) __attribute__ ((__format__ (__printf__, fmt, narg)))
464#endif 468#endif
465 469
470void diagmsg (int logf, int prio, const char *fmt, ...)
471 PIES_PRINTFLIKE(3,4);
472
466void logmsg (int prio, const char *fmt, ...) PIES_PRINTFLIKE(2,3); 473void logmsg (int prio, const char *fmt, ...) PIES_PRINTFLIKE(2,3);
467void logmsg_printf (int prio, const char *fmt, ...) PIES_PRINTFLIKE(2,3); 474void logmsg_printf (int prio, const char *fmt, ...) PIES_PRINTFLIKE(2,3);
468void logmsg_vprintf (int prio, const char *fmt, va_list ap); 475void logmsg_vprintf (int prio, const char *fmt, va_list ap);

Return to:

Send suggestions and report system problems to the System administrator.