From: Lukáš Ježek Date: Mon, 26 Jul 2021 12:55:58 +0000 (+0200) Subject: log: use kr_log_crit instead of kr_log_fatal X-Git-Tag: v5.4.0~2^2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89fc31764a9f32a689a698d13362d06bddb24882;p=thirdparty%2Fknot-resolver.git log: use kr_log_crit instead of kr_log_fatal --- diff --git a/lib/cache/entry_list.c b/lib/cache/entry_list.c index 38334c092..a24c822e8 100644 --- a/lib/cache/entry_list.c +++ b/lib/cache/entry_list.c @@ -198,7 +198,7 @@ recovery: // Try to recover by clearing cache. ret = kr_cache_clear(cache); switch (ret) { default: - kr_log_fatal(CACHE, "CRITICAL: clearing cache failed: %s; fatal error, aborting\n", + kr_log_crit(CACHE, "CRITICAL: clearing cache failed: %s; fatal error, aborting\n", kr_strerror(ret)); abort(); case 0: diff --git a/lib/log.h b/lib/log.h index d1468cdb3..3b72dabb8 100644 --- a/lib/log.h +++ b/lib/log.h @@ -182,7 +182,7 @@ void kr_log_init(log_level_t level, log_target_t target); #define kr_log_error(grp, fmt, ...) \ kr_log_fmt(LOG_GRP_ ## grp, LOG_ERR, SD_JOURNAL_METADATA, \ "[%-6s] " fmt, LOG_GRP_ ## grp ## _TAG, ## __VA_ARGS__) -#define kr_log_fatal(grp, fmt, ...) \ +#define kr_log_crit(grp, fmt, ...) \ kr_log_fmt(LOG_GRP_ ## grp, LOG_CRIT, SD_JOURNAL_METADATA, \ "[%-6s] " fmt, LOG_GRP_ ## grp ## _TAG, ## __VA_ARGS__) diff --git a/lib/utils.c b/lib/utils.c index 3b55f866c..1410b7e9b 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -39,7 +39,7 @@ void kr_fail(bool is_fatal, const char *expr, const char *func, const char *file { const int errno_orig = errno; if (is_fatal) - kr_log_fatal(SYSTEM, "requirement \"%s\" failed in %s@%s:%d\n", expr, func, file, line); + kr_log_crit(SYSTEM, "requirement \"%s\" failed in %s@%s:%d\n", expr, func, file, line); else kr_log_error(SYSTEM, "assertion \"%s\" failed in %s@%s:%d\n", expr, func, file, line);