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().
This commit is contained in:
Mike Yuan
2024-07-31 21:40:28 +02:00
parent c4c416b109
commit 8574b7940b
2 changed files with 7 additions and 7 deletions
-1
View File
@@ -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, &params->files_env);
if (r < 0)
+7 -6
View File
@@ -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))