summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-01-13 18:44:29 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-01-13 18:44:29 +0000
commit857b5c494b814a835973b23932f76d0283a18cc1 (patch)
tree73924cbeea71138303c815a363b544a0cf69d1a1 /common
parent5603520e2008d58609e3526d3eb45e088bfcb1d1 (diff)
Allow parameters for init message
Diffstat (limited to 'common')
-rw-r--r--common/logging.c17
-rw-r--r--common/logging.h2
2 files changed, 15 insertions, 4 deletions
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)
diff --git a/common/logging.h b/common/logging.h
index 9ccc349d..c9134425 100644
--- a/common/logging.h
+++ b/common/logging.h
@@ -30,7 +30,7 @@ void debug(const char *format, ...);
void toggle_debug(void);
void enable_debug(void);
void disable_debug(void);
-void start_logging(const char *ident, const char *message);
+void start_logging(const char *ident, const char *message, ...);
void stop_logging(void);
#endif /* __LOGGING_H */