Skip to content
Snippets Groups Projects
Verified Commit 22ae1bbe authored by Vladimír Čunát's avatar Vladimír Čunát Committed by Tomas Krizek
Browse files

lib/log detail: avoid a bit of duplication

parent 9eec44f7
No related branches found
No related tags found
1 merge request!1181Fine grained logging
......@@ -14,8 +14,9 @@
#include <stdlib.h>
#include <systemd/sd-daemon.h>
#include <systemd/sd-journal.h>
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))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment