diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-10-26 19:43:47 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-10-26 19:43:47 +0200 |
commit | e1038263368bc2a70ce59f1543e808b5b958c5cb (patch) | |
tree | 9dd4777cf0aaad6ce18dfbf1c6cc358156863207 /src/pies.h | |
parent | fd2468864b719af4cfb0266b1bb8c6b0dbd53aa0 (diff) | |
download | pies-e1038263368bc2a70ce59f1543e808b5b958c5cb.tar.gz pies-e1038263368bc2a70ce59f1543e808b5b958c5cb.tar.bz2 |
Improve diagnostic output.
* src/diag.c (diag_output): New variable.
(diag_setup): New function.
(vlogmsg): Use diag_output to decide where to
output the message. Output to both stderr and
syslog if diag_output says so.
* src/pies.c (log_to_stderr): Rename to log_to_stderr_only.
All uses changed.
(log_setup): Remove.
(main): Use diag_setup to initialize diagnostics.
* src/pies.h (log_to_stderr): Remove.
(DIAG_TO_SYSLOG, DIAG_TO_STDERR): New defines.
(diag_setup): New function.
Diffstat (limited to 'src/pies.h')
-rw-r--r-- | src/pies.h | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -168,7 +168,6 @@ struct component struct action act_temp; /* Auxiliary object used during configuration */ }; -extern int log_to_stderr; extern char *log_tag; extern int log_facility; extern unsigned long shutdown_timeout; @@ -257,6 +256,16 @@ int meta1error (char *s); int meta1parse (void); +/* diag.c */ +#define DIAG_TO_SYSLOG 0x1 +#define DIAG_TO_STDERR 0x2 + +extern int diag_output; + +#define DIAG_OUTPUT(x) (diag_output & (x)) + +void diag_setup (int flags); + void logmsg (int prio, const char *fmt, ...); void logmsg_printf (int prio, const char *fmt, ...); void logmsg_vprintf (int prio, const char *fmt, va_list ap); |