mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-08 08:23:34 -05:00
#1141 Fixed log in background mode.
This commit is contained in:
@@ -91,6 +91,10 @@ public:
|
||||
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
|
||||
if (Log::background && m_backends.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
timestamp(level, size, offset);
|
||||
color(level, size);
|
||||
|
||||
@@ -190,8 +194,9 @@ private:
|
||||
};
|
||||
|
||||
|
||||
bool Log::colors = true;
|
||||
LogPrivate *Log::d = new LogPrivate();
|
||||
bool Log::background = false;
|
||||
bool Log::colors = true;
|
||||
LogPrivate *Log::d = new LogPrivate();
|
||||
|
||||
|
||||
} /* namespace xmrig */
|
||||
|
||||
@@ -54,6 +54,7 @@ public:
|
||||
static void print(const char *fmt, ...);
|
||||
static void print(Level level, const char *fmt, ...);
|
||||
|
||||
static bool background;
|
||||
static bool colors;
|
||||
|
||||
private:
|
||||
|
||||
@@ -184,7 +184,10 @@ int xmrig::Base::init()
|
||||
Platform::setProcessPriority(config()->cpu().priority());
|
||||
# endif
|
||||
|
||||
if (!config()->isBackground()) {
|
||||
if (config()->isBackground()) {
|
||||
Log::background = true;
|
||||
}
|
||||
else {
|
||||
Log::add(new ConsoleLog());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user