mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-11 05:14:40 +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) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
d_ptr->enabled = enabled;
|
d_ptr->enabled = enabled;
|
||||||
|
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
LOG_INFO(GREEN_BOLD("resumed"));
|
LOG_INFO("%s " GREEN_BOLD("resumed"), Tags::miner());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (d_ptr->battery_power) {
|
if (d_ptr->battery_power) {
|
||||||
LOG_INFO(YELLOW_BOLD("paused"));
|
LOG_INFO("%s " YELLOW_BOLD("paused"), Tags::miner());
|
||||||
}
|
}
|
||||||
else {
|
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()) {
|
if (!d_ptr->controller->config()->mineOnBattery()) {
|
||||||
const bool battery_power = xmrig::Platform::isOnBatteryPower();
|
const bool battery_power = xmrig::Platform::isOnBatteryPower();
|
||||||
if (battery_power && d_ptr->enabled) {
|
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;
|
d_ptr->battery_power = true;
|
||||||
setEnabled(false);
|
setEnabled(false);
|
||||||
}
|
}
|
||||||
else if (!battery_power && !d_ptr->enabled && d_ptr->battery_power) {
|
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;
|
d_ptr->battery_power = false;
|
||||||
setEnabled(true);
|
setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue