From ca7fe1a2a68601d6fbfc9495cbe536047bbd47b0 Mon Sep 17 00:00:00 2001 From: wangdan Date: Tue, 22 Aug 2023 21:23:47 +0800 Subject: [PATCH] [SKV-713] fix(logs): fix logs in FATAL level not take effect (#1573) --- src/rdsn/src/utils/simple_logger.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/rdsn/src/utils/simple_logger.cpp b/src/rdsn/src/utils/simple_logger.cpp index 69fcf070f7..834ca498cb 100644 --- a/src/rdsn/src/utils/simple_logger.cpp +++ b/src/rdsn/src/utils/simple_logger.cpp @@ -99,6 +99,10 @@ void screen_logger::dsn_logv(const char *file, } vprintf(fmt, args); printf("\n"); + + if (dsn_unlikely(log_level >= LOG_LEVEL_FATAL)) { + dsn_coredump(); + } } void screen_logger::flush() { ::fflush(stdout); } @@ -300,6 +304,10 @@ void simple_logger::dsn_log(const char *file, printf("%s\n", str); } + if (dsn_unlikely(log_level >= LOG_LEVEL_FATAL)) { + dsn_coredump(); + } + if (_file_bytes >= FLAGS_max_log_file_bytes) { create_log_file(); }