]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/shared/battery-util.c
NEWS: finalize for v256~rc3
[thirdparty/systemd.git] / src / shared / battery-util.c
index 8b7bdc704d2c995c90d2a3339b1f769688b979c8..37b3f6a6ea35767fa92c6920ddca4d593ba6b928 100644 (file)
@@ -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;
 }
@@ -241,20 +241,19 @@ int battery_is_discharging_and_low(void) {
 
         r = on_ac_power();
         if (r < 0)
-                log_debug_errno(r, "Failed to check if the system is running on AC, assuming it is not: %m");
+                log_warning_errno(r, "Failed to check if the system is running on AC, assuming it is not: %m");
         if (r > 0)
                 return false;
 
         r = battery_enumerator_new(&e);
         if (r < 0)
-                return log_debug_errno(r, "Failed to initialize battery enumerator: %m");
+                return log_error_errno(r, "Failed to initialize battery enumerator: %m");
 
         FOREACH_DEVICE(e, dev) {
                 int level;
 
                 level = battery_read_capacity_percentage(dev);
                 if (level < 0) {
-                        log_device_debug_errno(dev, level, "Battery capacity is unreadable: %m");
                         unsure = true;
                         continue;
                 }
@@ -275,7 +274,7 @@ int battery_is_discharging_and_low(void) {
 
         /* If we found a battery whose state we couldn't read, don't assume we are in low battery state */
         if (unsure) {
-                log_info("Found battery with unreadable state, assuming not in low battery state.");
+                log_notice("Found battery with unreadable state, assuming not in low battery state.");
                 return false;
         }