logging: Call preinit before parsing log config

Since help text containing ANSI escape codes can be shown during parsing
(i.e. on error or help text), preinit should be called sooner
This commit is contained in:
Martin Piatka
2022-07-28 15:16:42 +02:00
parent d496f738f2
commit d18fb0300e
3 changed files with 8 additions and 7 deletions

View File

@@ -300,10 +300,8 @@ bool parse_log_cfg(const char *conf_str,
return false;
}
void Logger::preinit(bool skip_repeated, log_timestamp_mode show_timestamps)
void Logger::preinit()
{
Logger::skip_repeated = skip_repeated;
Logger::show_timestamps = show_timestamps;
if (rang::rang_implementation::supportsColor()
&& rang::rang_implementation::isTerminal(std::cout.rdbuf())
&& rang::rang_implementation::isTerminal(std::cerr.rdbuf())) {