diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-11-13 20:16:45 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-11-16 15:22:48 +0100 |
commit | b344b363ce26c13fcd27df5dc5ecf45e426329a0 (patch) | |
tree | b95d4ac138a449227fc82f3edb8231105c99c978 | |
parent | core: move unit_status_emit_starting_stopping_reloading() and related calls t... (diff) | |
download | systemd-b344b363ce26c13fcd27df5dc5ecf45e426329a0.tar.xz systemd-b344b363ce26c13fcd27df5dc5ecf45e426329a0.zip |
job: also include job ID in log messages when we begin with a job
-rw-r--r-- | src/core/job.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/job.c b/src/core/job.c index 42474ce59d..bf3db5a887 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -550,11 +550,13 @@ static void job_print_begin_status_message(Unit *u, JobType t) { REENABLE_WARNING; } -static void job_log_begin_status_message(Unit *u, JobType t) { +static void job_log_begin_status_message(Unit *u, uint32_t job_id, JobType t) { const char *format, *mid; char buf[LINE_MAX]; assert(u); + assert(t >= 0); + assert(t < _JOB_TYPE_MAX); if (!IN_SET(t, JOB_START, JOB_STOP, JOB_RELOAD)) return; @@ -582,17 +584,19 @@ static void job_log_begin_status_message(Unit *u, JobType t) { * name. */ log_struct(LOG_INFO, LOG_MESSAGE("%s", buf), + "JOB_ID=%" PRIu32, job_id, + "JOB_TYPE=%s", job_type_to_string(t), LOG_UNIT_ID(u), LOG_UNIT_INVOCATION_ID(u), mid); } -static void job_emit_begin_status_message(Unit *u, JobType t) { +static void job_emit_begin_status_message(Unit *u, uint32_t job_id, JobType t) { assert(u); assert(t >= 0); assert(t < _JOB_TYPE_MAX); - job_log_begin_status_message(u, t); + job_log_begin_status_message(u, job_id, t); job_print_begin_status_message(u, t); } @@ -641,7 +645,7 @@ static int job_perform_on_unit(Job **j) { * actually did something. */ *j = manager_get_job(m, id); if (*j && r > 0) - job_emit_begin_status_message(u, t); + job_emit_begin_status_message(u, id, t); return r; } |