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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2012-10-13 14:26:30 +02:00
parent c0735bb218
commit 1ca6783f5e
10 changed files with 20 additions and 20 deletions
+2 -2
View File
@@ -701,7 +701,7 @@ static DBusHandlerResult timedate_message_handler(
}
log_struct(LOG_INFO,
"MESSAGE_ID=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL(SD_MESSAGE_TIMEZONE_CHANGE),
MESSAGE_ID(SD_MESSAGE_TIMEZONE_CHANGE),
"TIMEZONE=%s", tz.zone,
"MESSAGE=Changed timezone to '%s'.", tz.zone,
NULL);
@@ -843,7 +843,7 @@ static DBusHandlerResult timedate_message_handler(
hwclock_set_time(tm);
log_struct(LOG_INFO,
"MESSAGE_ID=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL(SD_MESSAGE_TIME_CHANGE),
MESSAGE_ID(SD_MESSAGE_TIME_CHANGE),
"REALTIME=%llu", (unsigned long long) timespec_load(&ts),
"MESSAGE=Changed local time to %s", ctime(&ts.tv_sec),
NULL);