diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2016-02-18 08:12:39 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2016-02-18 08:17:35 +0200 |
commit | d5302613a00915076b945b25b50eb6b376121955 (patch) | |
tree | 58c8ba0120c52632f008dff191532afc8decaf79 /src/pies.c | |
parent | e430f586ccf6621136089fb1d9d865ce1a351360 (diff) | |
download | pies-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.c')
-rw-r--r-- | src/pies.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1968,7 +1968,7 @@ main (int argc, char **argv) /* Set default logging */ if (init_process) - diag_flags = DIAG_TO_STDERR; + diag_flags = DIAG_TO_STDERR | DIAG_REOPEN_LOG; else diag_flags = DIAG_TO_SYSLOG | (stderr_closed_p () ? 0 : DIAG_TO_STDERR); @@ -2137,8 +2137,9 @@ main (int argc, char **argv) (unsigned long) pid); exit (EX_USAGE); } - - logmsg (LOG_INFO, _("%s %s starting"), proginfo.package, proginfo.version); + + logmsg (LOG_INFO, + _("%s %s starting"), proginfo.package, proginfo.version); if (!foreground) { |