]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
logging: disable all debug messages in non-debug build
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 19 Nov 2019 13:59:21 +0000 (14:59 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 19 Nov 2019 13:59:21 +0000 (14:59 +0100)
For consistency, don't print debug messages that are compiled in due to
using the LOG macro instead of DEBUG_LOG.

client.c
logging.c

index 3f3363c66fbb59b05f0f0544c2fae8a7c8373f6d..99aaa82a05fab141d7f1a83771f4d420abae179d 100644 (file)
--- a/client.c
+++ b/client.c
@@ -3208,7 +3208,9 @@ main(int argc, char **argv)
         csv_mode = 1;
         break;
       case 'd':
+#if DEBUG > 0
         log_min_severity = LOGS_DEBUG;
+#endif
         break;
       case 'h':
         hostnames = optarg;
index 18143375b5744310c43179e65fb3f178be319c21..8b635a5ec721ea139a3a517efbbe782a855bfaac 100644 (file)
--- a/logging.c
+++ b/logging.c
@@ -214,7 +214,8 @@ LOG_OpenSystemLog(void)
 
 void LOG_SetMinSeverity(LOG_Severity severity)
 {
-  log_min_severity = CLAMP(LOGS_DEBUG, severity, LOGS_FATAL);
+  /* Don't print any debug messages in a non-debug build */
+  log_min_severity = CLAMP(DEBUG > 0 ? LOGS_DEBUG : LOGS_INFO, severity, LOGS_FATAL);
 }
 
 /* ================================================== */