Commit 434d05fc by Greg Kurz Committed by Daniel Lezcano

lxc: default log appender on stderr

The default appender for logs is currently the file one: this make macros from log.h unusable as long as lxc_log_init() hasn't been called. This prevents errors from even being printed on stderr in lxc_caps_init() for example. Let's make stderr the default appender. Signed-off-by: 's avatarGreg Kurz <gkurz@fr.ibm.com> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 326afe51
...@@ -111,7 +111,7 @@ static struct lxc_log_category log_root = { ...@@ -111,7 +111,7 @@ static struct lxc_log_category log_root = {
struct lxc_log_category lxc_log_category_lxc = { struct lxc_log_category lxc_log_category_lxc = {
.name = "lxc", .name = "lxc",
.priority = LXC_LOG_PRIORITY_ERROR, .priority = LXC_LOG_PRIORITY_ERROR,
.appender = &log_appender_logfile, .appender = &log_appender_stderr,
.parent = &log_root .parent = &log_root
}; };
...@@ -163,6 +163,7 @@ extern int lxc_log_init(const char *file, const char *priority, ...@@ -163,6 +163,7 @@ extern int lxc_log_init(const char *file, const char *priority,
} }
lxc_log_category_lxc.priority = lxc_priority; lxc_log_category_lxc.priority = lxc_priority;
lxc_log_category_lxc.appender = &log_appender_logfile;
if (!quiet) if (!quiet)
lxc_log_category_lxc.appender->next = &log_appender_stderr; lxc_log_category_lxc.appender->next = &log_appender_stderr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment