mirror of
https://github.com/xmrig/xmrig.git
synced 2024-12-23 12:09:22 +00:00
Add tags
This commit is contained in:
parent
e59806d6ae
commit
6484bbb716
1 changed files with 7 additions and 6 deletions
|
@ -431,21 +431,22 @@ void xmrig::Miner::setEnabled(bool enabled)
|
|||
}
|
||||
|
||||
if (d_ptr->battery_power && enabled) {
|
||||
LOG_INFO(YELLOW_BOLD("Can't resume while on battery power"));
|
||||
LOG_INFO("%s " YELLOW_BOLD("can't resume while on battery power"), Tags::miner());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
d_ptr->enabled = enabled;
|
||||
|
||||
if (enabled) {
|
||||
LOG_INFO(GREEN_BOLD("resumed"));
|
||||
LOG_INFO("%s " GREEN_BOLD("resumed"), Tags::miner());
|
||||
}
|
||||
else {
|
||||
if (d_ptr->battery_power) {
|
||||
LOG_INFO(YELLOW_BOLD("paused"));
|
||||
LOG_INFO("%s " YELLOW_BOLD("paused"), Tags::miner());
|
||||
}
|
||||
else {
|
||||
LOG_INFO(YELLOW_BOLD("paused") ", press " MAGENTA_BG_BOLD(" r ") " to resume");
|
||||
LOG_INFO("%s " YELLOW_BOLD("paused") ", press " MAGENTA_BG_BOLD(" r ") " to resume", Tags::miner());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -553,12 +554,12 @@ void xmrig::Miner::onTimer(const Timer *)
|
|||
if (!d_ptr->controller->config()->mineOnBattery()) {
|
||||
const bool battery_power = xmrig::Platform::isOnBatteryPower();
|
||||
if (battery_power && d_ptr->enabled) {
|
||||
LOG_INFO(YELLOW_BOLD("On battery power"));
|
||||
LOG_INFO("%s " YELLOW_BOLD("on battery power"), Tags::miner());
|
||||
d_ptr->battery_power = true;
|
||||
setEnabled(false);
|
||||
}
|
||||
else if (!battery_power && !d_ptr->enabled && d_ptr->battery_power) {
|
||||
LOG_INFO(GREEN_BOLD("On AC power"));
|
||||
LOG_INFO("%s " GREEN_BOLD("on AC power"), Tags::miner());
|
||||
d_ptr->battery_power = false;
|
||||
setEnabled(true);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue