From 09c8768a0b9df16c4ed4a33a8b926eb96b937fc8 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Sat, 30 Jan 2021 12:10:09 +0100 Subject: [PATCH] log: rework lxc_log_get_level() Signed-off-by: Christian Brauner --- src/lxc/log.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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) -- 2.47.2