log: add link to llog

Add helper function that can be used as llog backend.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2012-06-24 17:55:26 +02:00
parent a8f034fcbe
commit 35bea2847b
2 changed files with 23 additions and 0 deletions

View File

@ -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)

View File

@ -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);