battery-util: don't log duplicate message
Follow-up for 02f7f8aa4f
Addresses https://github.com/systemd/systemd/pull/28597#discussion_r1288591215
> this is pretty unnecessary, battery_read_capacity_percentage()
debug logs on its own about this already, in more detailed way?
This commit is contained in:
@@ -224,7 +224,7 @@ int battery_read_capacity_percentage(sd_device *dev) {
|
||||
return log_device_debug_errno(dev, r, "Failed to read/parse POWER_SUPPLY_CAPACITY: %m");
|
||||
|
||||
if (battery_capacity < 0 || battery_capacity > 100)
|
||||
return log_device_debug_errno(dev, SYNTHETIC_ERRNO(ERANGE), "Invalid battery capacity");
|
||||
return log_device_debug_errno(dev, SYNTHETIC_ERRNO(ERANGE), "Invalid battery capacity: %d", battery_capacity);
|
||||
|
||||
return battery_capacity;
|
||||
}
|
||||
@@ -254,7 +254,6 @@ int battery_is_discharging_and_low(void) {
|
||||
|
||||
level = battery_read_capacity_percentage(dev);
|
||||
if (level < 0) {
|
||||
log_device_debug_errno(dev, level, "Battery capacity is unreadable: %m");
|
||||
unsure = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user