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
+1
View File
@@ -396,6 +396,7 @@ int exec_spawn(
assert(ret);
LOG_CONTEXT_PUSH_UNIT(unit);
LOG_CONTEXT_SET_LOG_LEVEL(context->log_level_max >= 0 ? context->log_level_max : log_get_max_level());
r = exec_context_load_environment(unit, context, &params->files_env);
if (r < 0)