diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2023-01-01 10:24:12 +0000 |
---|---|---|
committer | SChernykh <sergey.v.chernykh@gmail.com> | 2023-10-31 09:09:55 +0100 |
commit | 6c38c21dfd459da9dde66737723c3c3ea446ec17 (patch) | |
tree | 2bc76227dcd7909101c270ff6a1870d78e2a11e6 /external | |
parent | Merge pull request #9027 (diff) | |
download | monero-6c38c21dfd459da9dde66737723c3c3ea446ec17.tar.xz |
heed NO_COLOR environment variable
Diffstat (limited to 'external')
-rw-r--r-- | external/easylogging++/easylogging++.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/external/easylogging++/easylogging++.cc b/external/easylogging++/easylogging++.cc index a765ee8cc..891936b6b 100644 --- a/external/easylogging++/easylogging++.cc +++ b/external/easylogging++/easylogging++.cc @@ -149,6 +149,11 @@ static el::Color colorFromLevel(el::Level level) static void setConsoleColor(el::Color color, bool bright) { + static const char *no_color_var = getenv("NO_COLOR"); + static const bool no_color = no_color_var && *no_color_var; // apparently, NO_COLOR=0 means no color too (as per no-color.org) + if (no_color) + return; + #if ELPP_OS_WINDOWS HANDLE h_stdout = GetStdHandle(STD_OUTPUT_HANDLE); switch (color) |