]> git.ipfire.org Git - zone-sync.git/commitdiff
main: Enable debug logging only when requested
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 11 May 2026 15:59:28 +0000 (15:59 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 11 May 2026 15:59:28 +0000 (15:59 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
main.c

diff --git a/main.c b/main.c
index 22d11d22fac8d1003c0a6bf1aed3a71948b6dd2b..784cebd8e78ba549aa774b30bb2651bd08a03cf1 100644 (file)
--- a/main.c
+++ b/main.c
@@ -93,6 +93,7 @@ typedef struct ctx {
 
 // Create the context
 static ctx_t ctx = {
+       .log_level = LOG_INFO,
        .path      = DEFAULT_PATH,
        .transport = DNS_TRANSPORT_NONE,
        .port      = 53,
@@ -146,7 +147,8 @@ static void setup_logging(void) {
        isc_log_create(ctx.memctx, &ctx.log, &logcfg);
 
        /* Crank up debug verbosity */
-       isc_log_setdebuglevel(ctx.log, 99);
+       if (ctx.log_level == LOG_DEBUG)
+               isc_log_setdebuglevel(ctx.log, 99);
 
        /* Define a channel that writes everything to stderr */
        isc_logdestination_t dest = {