mirror of https://github.com/SChernykh/p2pool
Check for `NO_COLOR` before logging starts
parent
248f74d948
commit
260564cff1
10
src/log.cpp
10
src/log.cpp
|
@ -21,6 +21,11 @@
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable : 4996)
|
||||||
|
#endif
|
||||||
|
|
||||||
static constexpr char log_category_prefix[] = "Log ";
|
static constexpr char log_category_prefix[] = "Log ";
|
||||||
static constexpr char log_file_name[] = "p2pool.log";
|
static constexpr char log_file_name[] = "p2pool.log";
|
||||||
|
@ -86,6 +91,11 @@ public:
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
const char* no_color = getenv("NO_COLOR");
|
||||||
|
if (no_color && *no_color) {
|
||||||
|
CONSOLE_COLORS = false;
|
||||||
|
}
|
||||||
|
|
||||||
LOGINFO(0, "started");
|
LOGINFO(0, "started");
|
||||||
|
|
||||||
if (!m_logFile.is_open()) {
|
if (!m_logFile.is_open()) {
|
||||||
|
|
|
@ -19,11 +19,6 @@
|
||||||
#include "params.h"
|
#include "params.h"
|
||||||
#include "stratum_server.h"
|
#include "stratum_server.h"
|
||||||
#include "p2p_server.h"
|
#include "p2p_server.h"
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#pragma warning(disable : 4996)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void p2pool_usage();
|
void p2pool_usage();
|
||||||
|
|
||||||
|
@ -31,11 +26,6 @@ namespace p2pool {
|
||||||
|
|
||||||
Params::Params(int argc, char* argv[])
|
Params::Params(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
const char* no_color = getenv("NO_COLOR");
|
|
||||||
if (no_color && *no_color) {
|
|
||||||
log::CONSOLE_COLORS = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 1; i < argc; ++i) {
|
for (int i = 1; i < argc; ++i) {
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue