From: Christian Brauner Date: Sat, 30 Jan 2021 11:10:09 +0000 (+0100) Subject: log: rework lxc_log_get_level() X-Git-Tag: lxc-5.0.0~312^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09c8768a0b9df16c4ed4a33a8b926eb96b937fc8;p=thirdparty%2Flxc.git log: rework lxc_log_get_level() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/log.c b/src/lxc/log.c index bc60083fe..7f1d5a861 100644 --- a/src/lxc/log.c +++ b/src/lxc/log.c @@ -778,7 +778,16 @@ int lxc_log_set_level(int *dest, int level) int lxc_log_get_level(void) { - return lxc_log_category_lxc.priority; + int level = LXC_LOG_LEVEL_NOTSET; + +#ifndef NO_LXC_CONF + if (current_config) + level = current_config->loglevel; +#endif + if (level == LXC_LOG_LEVEL_NOTSET) + level = lxc_log_category_lxc.priority; + + return level; } bool lxc_log_has_valid_level(void)