From 857b5c494b814a835973b23932f76d0283a18cc1 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 13 Jan 2007 18:44:29 +0000 Subject: Allow parameters for init message --- common/logging.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'common/logging.c') diff --git a/common/logging.c b/common/logging.c index 123dd809..79d8d362 100644 --- a/common/logging.c +++ b/common/logging.c @@ -31,13 +31,18 @@ static volatile int debug_enabled = 0; +static inline void vinfo(const char *format, va_list ap) +{ + vsyslog(LOG_INFO, format, ap); +} + void info(const char *format, ...) { va_list ap; va_start(ap, format); - vsyslog(LOG_INFO, format, ap); + vinfo(format, ap); va_end(ap); } @@ -82,11 +87,17 @@ void disable_debug(void) debug_enabled = 0; } -void start_logging(const char *ident, const char *message) +void start_logging(const char *ident, const char *message, ...) { + va_list ap; + openlog(ident, LOG_PID | LOG_NDELAY | LOG_PERROR, LOG_DAEMON); - info(message); + va_start(ap, message); + + vinfo(message, ap); + + va_end(ap); } void stop_logging(void) -- cgit