summaryrefslogtreecommitdiff
path: root/src/backlight/backlight.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2020-11-23 16:17:04 +0900
committerLennart Poettering <lennart@poettering.net>2020-11-23 14:35:14 +0100
commit8dc1ad04c2f580f11967402a372fdc3ef55dbfe2 (patch)
treef112eb61a0a143f513ddc061733c9157e45ca4a9 /src/backlight/backlight.c
parent1d370b2c182505ff8033fccbebcc56621d305220 (diff)
downloadsystemd-8dc1ad04c2f580f11967402a372fdc3ef55dbfe2.tar.gz
backlight: add several debug logs and adjust log level of non critical error
This may help to investigate issues.
Diffstat (limited to 'src/backlight/backlight.c')
-rw-r--r--src/backlight/backlight.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c
index 83b168532a..d1b6a81e33 100644
--- a/src/backlight/backlight.c
+++ b/src/backlight/backlight.c
@@ -252,6 +252,7 @@ static int get_max_brightness(sd_device *device, unsigned *ret) {
if (max_brightness <= 0)
return log_device_warning_errno(device, SYNTHETIC_ERRNO(EINVAL), "Maximum brightness is 0, ignoring device.");
+ log_device_debug(device, "Maximum brightness is %u", max_brightness);
*ret = max_brightness;
return 0;
}
@@ -348,6 +349,7 @@ static int read_brightness(sd_device *device, unsigned max_brightness, unsigned
goto use_brightness;
}
+ log_device_debug(device, "Current actual_brightness is %u", brightness);
*ret_brightness = brightness;
return 0;
}
@@ -366,6 +368,7 @@ use_brightness:
"brightness=%u is larger than max_brightness=%u",
brightness, max_brightness);
+ log_device_debug(device, "Current brightness is %u", brightness);
*ret_brightness = brightness;
return 0;
}
@@ -456,10 +459,11 @@ static int run(int argc, char *argv[]) {
if (r > 0) {
r = safe_atou(value, &brightness);
if (r < 0) {
- log_error_errno(r, "Failed to parse saved brightness '%s', removing %s.",
- value, saved);
+ log_warning_errno(r, "Failed to parse saved brightness '%s', removing %s.",
+ value, saved);
(void) unlink(saved);
} else {
+ log_debug("Using saved brightness %u.", brightness);
if (clamp)
(void) clamp_brightness(device, true, max_brightness, &brightness);