From: Mike Yuan Date: Wed, 31 Jul 2024 17:51:23 +0000 (+0200) Subject: core/unit: merge use of LOG_CONTEXT_SET_LOG_LEVEL into LOG_CONTEXT_PUSH_UNIT X-Git-Tag: v257-rc1~785^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8574b7940b982b50a67a1fb05b209fd7aed438eb;p=thirdparty%2Fsystemd.git core/unit: merge use of LOG_CONTEXT_SET_LOG_LEVEL into LOG_CONTEXT_PUSH_UNIT No functional change, since LOG_CONTEXT_PUSH_UNIT is only used in exec_spawn(). --- diff --git a/src/core/execute.c b/src/core/execute.c index b909b81e325..959359907fd 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -396,7 +396,6 @@ 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, ¶ms->files_env); if (r < 0) diff --git a/src/core/unit.h b/src/core/unit.h index 4c900430b40..115948cd26d 100644 --- a/src/core/unit.h +++ b/src/core/unit.h @@ -1189,12 +1189,13 @@ typedef struct UnitForEachDependencyData { #define UNIT_FOREACH_DEPENDENCY(other, u, match_atom) \ _UNIT_FOREACH_DEPENDENCY(other, u, match_atom, UNIQ_T(data, UNIQ)) -#define _LOG_CONTEXT_PUSH_UNIT(unit, u, c) \ - const Unit *u = (unit); \ - const ExecContext *c = unit_get_exec_context(u); \ - LOG_CONTEXT_PUSH_KEY_VALUE(u->manager->unit_log_field, u->id); \ - LOG_CONTEXT_PUSH_KEY_VALUE(u->manager->invocation_log_field, u->invocation_id_string); \ - LOG_CONTEXT_PUSH_IOV(c ? c->log_extra_fields : NULL, c ? c->n_log_extra_fields : 0) +#define _LOG_CONTEXT_PUSH_UNIT(unit, u, c) \ + const Unit *u = (unit); \ + const ExecContext *c = unit_get_exec_context(u); \ + LOG_CONTEXT_PUSH_KEY_VALUE(u->manager->unit_log_field, u->id); \ + LOG_CONTEXT_PUSH_KEY_VALUE(u->manager->invocation_log_field, u->invocation_id_string); \ + LOG_CONTEXT_PUSH_IOV(c ? c->log_extra_fields : NULL, c ? c->n_log_extra_fields : 0); \ + LOG_CONTEXT_SET_LOG_LEVEL(c->log_level_max >= 0 ? c->log_level_max : log_get_max_level()) #define LOG_CONTEXT_PUSH_UNIT(unit) \ _LOG_CONTEXT_PUSH_UNIT(unit, UNIQ_T(u, UNIQ), UNIQ_T(c, UNIQ))