From 1ca6783f5ea3755bd83e723f529c2eda512c7fed Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Mon, 8 Oct 2012 17:02:30 +0000 Subject: log: introduce a macro to format message id The MESSAGE_ID=... stanza will appear in countless number of places. It is just too long to write it out in full each time. Incidentally, this also fixes a typo of MESSSAGE is three places. --- src/core/job.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/job.c') diff --git a/src/core/job.c b/src/core/job.c index 706910b695..cb5674b5a8 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -705,7 +705,7 @@ static void job_log_status_message(Unit *u, JobType t, JobResult result) { mid = result == JOB_DONE ? SD_MESSAGE_UNIT_STARTED : SD_MESSAGE_UNIT_FAILED; log_struct(result == JOB_DONE ? LOG_INFO : LOG_ERR, - "MESSSAGE_ID=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL(mid), + MESSAGE_ID(mid), "UNIT=%s", u->id, "RESULT=%s", job_result_to_string(result), "MESSAGE=%s", buf, @@ -713,7 +713,7 @@ static void job_log_status_message(Unit *u, JobType t, JobResult result) { } else if (t == JOB_STOP) log_struct(result == JOB_DONE ? LOG_INFO : LOG_ERR, - "MESSSAGE_ID=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL(SD_MESSAGE_UNIT_STOPPED), + MESSAGE_ID(SD_MESSAGE_UNIT_STOPPED), "UNIT=%s", u->id, "RESULT=%s", job_result_to_string(result), "MESSAGE=%s", buf, @@ -721,7 +721,7 @@ static void job_log_status_message(Unit *u, JobType t, JobResult result) { else if (t == JOB_RELOAD) log_struct(result == JOB_DONE ? LOG_INFO : LOG_ERR, - "MESSSAGE_ID=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL(SD_MESSAGE_UNIT_RELOADED), + MESSAGE_ID(SD_MESSAGE_UNIT_RELOADED), "UNIT=%s", u->id, "RESULT=%s", job_result_to_string(result), "MESSAGE=%s", buf, -- cgit v1.2.3-54-g00ecf