diff options
author | luigi1111 <luigi1111w@gmail.com> | 2019-10-08 14:43:53 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2019-10-08 14:43:53 -0500 |
commit | 577b06028c04be1b0266b74f7aa781afdc7449d0 (patch) | |
tree | ce498efae692d67d5ce73e7cf4b1501da9191300 /external/easylogging++/easylogging++.cc | |
parent | Merge pull request #5926 (diff) | |
parent | easylogging++: always omit ANSI codes when colour is not supported (diff) | |
download | monero-577b06028c04be1b0266b74f7aa781afdc7449d0.tar.xz |
Merge pull request #5927
6d378d9 easylogging++: always omit ANSI codes when colour is not supported (moneromooo-monero)
Diffstat (limited to 'external/easylogging++/easylogging++.cc')
-rw-r--r-- | external/easylogging++/easylogging++.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/external/easylogging++/easylogging++.cc b/external/easylogging++/easylogging++.cc index b89fd3daf..0f83e1de2 100644 --- a/external/easylogging++/easylogging++.cc +++ b/external/easylogging++/easylogging++.cc @@ -683,6 +683,11 @@ void LogBuilder::convertToColoredOutput(base::type::string_t* logLine, Level lev } } +void LogBuilder::setColor(Color color, bool bright) { + if (m_termSupportsColor) + el::base::utils::setConsoleColor(color, bright); +} + // Logger Logger::Logger(const std::string& id, base::LogStreamsReferenceMap* logStreamsReference) : @@ -2496,11 +2501,11 @@ void DefaultLogDispatchCallback::dispatch(base::type::string_t&& rawLinePrefix, if (m_data->logMessage()->logger()->m_typedConfigurations->toStandardOutput(m_data->logMessage()->level())) { const el::Level level = m_data->logMessage()->level(); const el::Color color = m_data->logMessage()->color(); - el::base::utils::setConsoleColor(el::base::utils::colorFromLevel(level), false); + m_data->logMessage()->logger()->logBuilder()->setColor(el::base::utils::colorFromLevel(level), false); ELPP_COUT << rawLinePrefix; - el::base::utils::setConsoleColor(color == el::Color::Default ? el::base::utils::colorFromLevel(level): color, color != el::Color::Default); + m_data->logMessage()->logger()->logBuilder()->setColor(color == el::Color::Default ? el::base::utils::colorFromLevel(level): color, color != el::Color::Default); ELPP_COUT << rawLinePayload; - el::base::utils::setConsoleColor(el::Color::Default, false); + m_data->logMessage()->logger()->logBuilder()->setColor(el::Color::Default, false); ELPP_COUT << std::flush; } } |