From bfd7c00ced1b376c56cfba5aa36bc5542fcfa3ae Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sun, 1 Jan 2023 10:24:12 +0000 Subject: heed NO_COLOR environment variable --- external/easylogging++/easylogging++.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'external/easylogging++') 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) -- cgit v1.2.3