Check for NO_COLOR before logging starts

This commit is contained in:
SChernykh
2023-01-01 22:12:16 +01:00
parent 248f74d948
commit 260564cff1
2 changed files with 10 additions and 10 deletions

View File

@@ -21,6 +21,11 @@
#include <ctime>
#include <fstream>
#include <thread>
#include <stdlib.h>
#ifdef _MSC_VER
#pragma warning(disable : 4996)
#endif
static constexpr char log_category_prefix[] = "Log ";
static constexpr char log_file_name[] = "p2pool.log";
@@ -86,6 +91,11 @@ public:
}
#endif
const char* no_color = getenv("NO_COLOR");
if (no_color && *no_color) {
CONSOLE_COLORS = false;
}
LOGINFO(0, "started");
if (!m_logFile.is_open()) {