From: Ivan Kruglov Date: Mon, 14 Jul 2025 09:46:28 +0000 (-0700) Subject: core: exec_log_level_max_with_exec_params() X-Git-Tag: v259-rc1~306^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3064c04473109ed2d6619099424b8285d48b9789;p=thirdparty%2Fsystemd.git core: exec_log_level_max_with_exec_params() --- diff --git a/src/core/execute.c b/src/core/execute.c index 6301d51ca24..76f30b14a8f 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -366,13 +366,17 @@ const char* exec_get_private_notify_socket_path(const ExecContext *context, cons return "/run/host/notify"; } -int exec_log_level_max(const ExecContext *context, const ExecParameters *params) { - assert(context); +int exec_log_level_max_with_exec_params(const ExecContext *context, const ExecParameters *params) { assert(params); if (params->debug_invocation) return LOG_DEBUG; + return exec_log_level_max(context); +} + +int exec_log_level_max(const ExecContext *context) { + assert(context); return context->log_level_max < 0 ? log_get_max_level() : context->log_level_max; } diff --git a/src/core/execute.h b/src/core/execute.h index 2e30374830a..8d0f06aeef8 100644 --- a/src/core/execute.h +++ b/src/core/execute.h @@ -633,7 +633,8 @@ bool exec_is_cgroup_mount_read_only(const ExecContext *context); const char* exec_get_private_notify_socket_path(const ExecContext *context, const ExecParameters *params, bool needs_sandboxing); -int exec_log_level_max(const ExecContext *context, const ExecParameters *params); +int exec_log_level_max_with_exec_params(const ExecContext *context, const ExecParameters *params); +int exec_log_level_max(const ExecContext *context); /* These logging macros do the same logging as those in unit.h, but using ExecContext and ExecParameters * instead of the unit object, so that it can be used in the sd-executor context (where the unit object is @@ -655,7 +656,7 @@ int exec_log_level_max(const ExecContext *context, const ExecParameters *params) LOG_CONTEXT_PUSH_KEY_VALUE(LOG_EXEC_ID_FIELD(p), p->unit_id); \ LOG_CONTEXT_PUSH_KEY_VALUE(LOG_EXEC_INVOCATION_ID_FIELD(p), p->invocation_id_string); \ LOG_CONTEXT_PUSH_IOV(c->log_extra_fields, c->n_log_extra_fields) \ - LOG_CONTEXT_SET_LOG_LEVEL(exec_log_level_max(c, p)) \ + LOG_CONTEXT_SET_LOG_LEVEL(exec_log_level_max_with_exec_params(c, p)) \ LOG_SET_PREFIX(p->unit_id); #define LOG_CONTEXT_PUSH_EXEC(ec, ep) \