Skip to content

Commit

Permalink
[SKV-713] fix(logs): fix logs in FATAL level not take effect (apache#…
Browse files Browse the repository at this point in the history
  • Loading branch information
wangdan committed Aug 22, 2023
1 parent 908d364 commit ca7fe1a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/rdsn/src/utils/simple_logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit ca7fe1a

Please sign in to comment.