mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-22 18:54:43 +00:00
#1141 Fixed log in background mode.
This commit is contained in:
parent
9cfbce5e09
commit
372183555b
3 changed files with 12 additions and 3 deletions
|
@ -91,6 +91,10 @@ public:
|
||||||
|
|
||||||
std::lock_guard<std::mutex> lock(m_mutex);
|
std::lock_guard<std::mutex> lock(m_mutex);
|
||||||
|
|
||||||
|
if (Log::background && m_backends.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
timestamp(level, size, offset);
|
timestamp(level, size, offset);
|
||||||
color(level, size);
|
color(level, size);
|
||||||
|
|
||||||
|
@ -190,6 +194,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
bool Log::background = false;
|
||||||
bool Log::colors = true;
|
bool Log::colors = true;
|
||||||
LogPrivate *Log::d = new LogPrivate();
|
LogPrivate *Log::d = new LogPrivate();
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,7 @@ public:
|
||||||
static void print(const char *fmt, ...);
|
static void print(const char *fmt, ...);
|
||||||
static void print(Level level, const char *fmt, ...);
|
static void print(Level level, const char *fmt, ...);
|
||||||
|
|
||||||
|
static bool background;
|
||||||
static bool colors;
|
static bool colors;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -184,7 +184,10 @@ int xmrig::Base::init()
|
||||||
Platform::setProcessPriority(config()->cpu().priority());
|
Platform::setProcessPriority(config()->cpu().priority());
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
if (!config()->isBackground()) {
|
if (config()->isBackground()) {
|
||||||
|
Log::background = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
Log::add(new ConsoleLog());
|
Log::add(new ConsoleLog());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue