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.
This commit is contained in:
Daan De Meyer
2024-07-31 13:12:55 +02:00
parent b56920e36c
commit 7881f485c9
3 changed files with 15 additions and 2 deletions
+4 -1
View File
@@ -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) {