]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: exec_log_level_max_with_exec_params()
authorIvan Kruglov <mail@ikruglov.com>
Mon, 14 Jul 2025 09:46:28 +0000 (02:46 -0700)
committerIvan Kruglov <mail@ikruglov.com>
Thu, 16 Oct 2025 10:52:08 +0000 (03:52 -0700)
src/core/execute.c
src/core/execute.h

index 6301d51ca2437e0ba8da4de72cdb91bf43b8cd7a..76f30b14a8feaeac105b0e4c8c00fa32902c6cd6 100644 (file)
@@ -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;
 }
 
index 2e30374830ae4ea09df92a74f4d4dcbf98ec212d..8d0f06aeef813da0d4dd8d953f7d4dacaa5f9039 100644 (file)
@@ -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) \