From 35bea2847bca4d15e4a23513b25e2fd7d4de25f4 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Sun, 24 Jun 2012 17:55:26 +0200 Subject: [PATCH] log: add link to llog Add helper function that can be used as llog backend. Signed-off-by: David Herrmann --- src/log.c | 11 +++++++++++ src/log.h | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/log.c b/src/log.c index 402ccec..53de10b 100644 --- a/src/log.c +++ b/src/log.c @@ -495,6 +495,17 @@ void log_format(const char *file, errno = saved_errno; } +void log_llog(const char *file, + int line, + const char *func, + const char *subs, + unsigned int sev, + const char *format, + va_list args) +{ + log_submit(file, line, func, NULL, subs, sev, format, args); +} + void log_print_init(const char *appname) { if (!appname) diff --git a/src/log.h b/src/log.h index aa3e0f6..909157a 100644 --- a/src/log.h +++ b/src/log.h @@ -156,6 +156,10 @@ void log_clean_filter(); * log_format: * Same as log_submit but first converts the arguments into a va_list object. * + * log_llog: + * Same as log_submit but used as connection to llog. It uses the default config + * for every message. + * * log_set_file(file): * This opens the file specified by \file and redirects all new messages to this * file. If \file is NULL, then the default is used which is stderr. @@ -190,6 +194,14 @@ void log_format(const char *file, const char *format, ...); +void log_llog(const char *file, + int line, + const char *func, + const char *subs, + unsigned int sev, + const char *format, + va_list args); + int log_set_file(const char *file); void log_print_init(const char *appname);