Check for NO_COLOR before logging starts
This commit is contained in:
10
src/log.cpp
10
src/log.cpp
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user