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:
+4
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user