From 89fc31764a9f32a689a698d13362d06bddb24882 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Luk=C3=A1=C5=A1=20Je=C5=BEek?= Date: Mon, 26 Jul 2021 14:55:58 +0200 Subject: [PATCH] log: use kr_log_crit instead of kr_log_fatal --- lib/cache/entry_list.c | 2 +- lib/log.h | 2 +- lib/utils.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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); -- 2.47.2