From bbc9006e6b5665073149331d75c104a33224dc19 Mon Sep 17 00:00:00 2001 From: Mirco Tischler Date: Thu, 17 Jan 2013 18:55:06 +0100 Subject: core: log USER_UNIT instead of UNIT if in user session --- src/core/job.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/core/job.c') diff --git a/src/core/job.c b/src/core/job.c index 31ab11880..e381ea2b6 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -713,25 +713,25 @@ static void job_log_status_message(Unit *u, JobType t, JobResult result) { sd_id128_t mid; mid = result == JOB_DONE ? SD_MESSAGE_UNIT_STARTED : SD_MESSAGE_UNIT_FAILED; - log_struct(result == JOB_DONE ? LOG_INFO : LOG_ERR, + log_struct_unit(result == JOB_DONE ? LOG_INFO : LOG_ERR, + u->id, MESSAGE_ID(mid), - "UNIT=%s", u->id, "RESULT=%s", job_result_to_string(result), "MESSAGE=%s", buf, NULL); } else if (t == JOB_STOP) - log_struct(result == JOB_DONE ? LOG_INFO : LOG_ERR, + log_struct_unit(result == JOB_DONE ? LOG_INFO : LOG_ERR, + u->id, MESSAGE_ID(SD_MESSAGE_UNIT_STOPPED), - "UNIT=%s", u->id, "RESULT=%s", job_result_to_string(result), "MESSAGE=%s", buf, NULL); else if (t == JOB_RELOAD) - log_struct(result == JOB_DONE ? LOG_INFO : LOG_ERR, + log_struct_unit(result == JOB_DONE ? LOG_INFO : LOG_ERR, + u->id, MESSAGE_ID(SD_MESSAGE_UNIT_RELOADED), - "UNIT=%s", u->id, "RESULT=%s", job_result_to_string(result), "MESSAGE=%s", buf, NULL); @@ -818,8 +818,8 @@ int job_finish_and_invalidate(Job *j, JobResult result, bool recursive) { * this context. And JOB_FAILURE is already handled by the * unit itself. */ if (result == JOB_TIMEOUT || result == JOB_DEPENDENCY) { - log_struct(LOG_NOTICE, - "UNIT=%s", u->id, + log_struct_unit(LOG_NOTICE, + u->id, "JOB_TYPE=%s", job_type_to_string(t), "JOB_RESULT=%s", job_result_to_string(result), "Job %s/%s failed with result '%s'.", -- cgit v1.2.3