From: Vladimír Čunát Date: Mon, 26 Jul 2021 18:56:43 +0000 (+0200) Subject: lib/log detail: avoid a bit of duplication X-Git-Tag: v5.4.0~2^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22ae1bbe1348230e97b216a11fb3086a58491100;p=thirdparty%2Fknot-resolver.git lib/log detail: avoid a bit of duplication --- diff --git a/lib/log.c b/lib/log.c index 92c520990..0a7f0cb38 100644 --- a/lib/log.c +++ b/lib/log.c @@ -14,8 +14,9 @@ #include #include #include - -int use_journal = 0; +bool use_journal = false; +#else +#define use_journal false #endif kr_log_level_t kr_log_level = LOG_CRIT; @@ -114,15 +115,13 @@ void kr_log_fmt(enum kr_log_group group, kr_log_level_t level, const char *file, setlogmask(LOG_UPTO(LOG_DEBUG)); va_start(args, fmt); -#if ENABLE_LIBSYSTEMD if (use_journal) { + #if ENABLE_LIBSYSTEMD sd_journal_printv_with_location(level, file, line, func, fmt, args); + #endif } else { vsyslog(level, fmt, args); } -#else - vsyslog(level, fmt, args); -#endif va_end(args); if (kr_log_group_is_set(group))