From: dhfelix Date: Wed, 3 Jun 2020 23:14:07 +0000 (-0500) Subject: Fix a logging problem X-Git-Tag: v1.3.0~10 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=18ba55295f44231d49327e883e7833f8e714f0cb;p=thirdparty%2FFORT-validator.git Fix a logging problem When validating the application settings, the error messages were not displayed. --- diff --git a/src/log.c b/src/log.c index 042b2a46..74669a7a 100644 --- a/src/log.c +++ b/src/log.c @@ -29,6 +29,9 @@ static bool op_syslog_enabled; static bool val_fprintf_enabled; static bool val_syslog_enabled; +static bool op_global_log_enabled; +static bool val_global_log_enabled; + void log_setup(void) { @@ -45,6 +48,9 @@ log_setup(void) op_syslog_enabled = true; val_fprintf_enabled = true; val_syslog_enabled = true; + + op_global_log_enabled = true; + val_global_log_enabled = true; } static void @@ -72,7 +78,10 @@ log_disable_syslog(void) void log_start(void) { - if (config_get_val_log_enabled()) { + val_global_log_enabled = config_get_val_log_enabled(); + op_global_log_enabled = config_get_op_log_enabled(); + + if (val_global_log_enabled) { switch (config_get_val_log_output()) { case SYSLOG: pr_op_info("Syslog log output configured; disabling validation logging on standard streams."); @@ -93,7 +102,8 @@ log_start(void) } - if (config_get_op_log_enabled()) { + + if (op_global_log_enabled) { switch (config_get_op_log_output()) { case SYSLOG: pr_op_info("Syslog log output configured; disabling operation logging on standard streams."); @@ -268,7 +278,7 @@ pr_stream(int level, char const *prefix, const char *format, bool color_output, bool color = config_get_op_log_color_output(); \ int facility = config_get_op_log_facility(); \ \ - if (!config_get_op_log_enabled()) \ + if (!op_global_log_enabled) \ break; \ \ if (level > config_get_op_log_level()) \ @@ -296,7 +306,7 @@ pr_stream(int level, char const *prefix, const char *format, bool color_output, bool color = config_get_val_log_color_output(); \ int facility = config_get_val_log_facility(); \ \ - if (!config_get_val_log_enabled()) \ + if (!val_global_log_enabled) \ break; \ \ if (level > config_get_val_log_level()) \