void SuperLogger::enable_message_coloring() { #ifndef _WIN32 const int StdErrFileDesc = 2; if (!isatty(StdErrFileDesc)) return; #endif set_log_target(create_console_log_target(stderr)); }
void SuperLogger::enable_message_coloring() { LogMessage::FormattingFlags flags[LogMessage::NumMessageCategories]; save_formatting_flags(*m_log_target, flags); remove_target(m_log_target); delete m_log_target; m_log_target = create_console_log_target(stderr); add_target(m_log_target); restore_formatting_flags(*m_log_target, flags); }