diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-07-31 13:11:51 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-07-31 13:12:55 +0200 |
commit | 7881f485c9f57b1c7de4308eeab54458890c5c19 (patch) | |
tree | 8c752215b83b23918da4eba05f9e3616faa8be56 /src/basic/log.c | |
parent | kernel-install: Try some more initrd variants in 90-loaderentry.install (diff) | |
download | systemd-7881f485c9f57b1c7de4308eeab54458890c5c19.tar.xz systemd-7881f485c9f57b1c7de4308eeab54458890c5c19.zip |
execute: Drop log level to unit log level in exec_spawn()
All messages logged from exec_spawn() are attributed to the unit
and as such we should set the log level to the unit's max log level
for the duration of the function.
Diffstat (limited to 'src/basic/log.c')
-rw-r--r-- | src/basic/log.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/basic/log.c b/src/basic/log.c index a8056d2635..09500f9cb0 100644 --- a/src/basic/log.c +++ b/src/basic/log.c @@ -396,9 +396,10 @@ void log_forget_fds(void) { console_fd_is_tty = -1; } -void log_set_max_level(int level) { +int log_set_max_level(int level) { assert(level == LOG_NULL || LOG_PRI(level) == level); + int old = log_max_level; log_max_level = level; /* Also propagate max log level to libc's syslog(), just in case some other component loaded into our @@ -411,6 +412,8 @@ void log_set_max_level(int level) { /* Ensure that our own LOG_NULL define maps sanely to the log mask */ assert_cc(LOG_UPTO(LOG_NULL) == 0); + + return old; } void log_set_facility(int facility) { |