tree-wide: check more log message format in log_struct() and friends
This introduce LOG_ITEM() macro that checks arbitrary formats in log_struct(). Then, drop _printf_ attribute from log_struct_internal(), as it does not help so much, and compiler checked only the first format string. Hopefully, this silences false-positive warnings by Coverity.
This commit is contained in:
@@ -537,9 +537,9 @@ int machine_start(Machine *m, sd_bus_message *properties, sd_bus_error *error) {
|
||||
return r;
|
||||
|
||||
log_struct(LOG_INFO,
|
||||
"MESSAGE_ID=" SD_MESSAGE_MACHINE_START_STR,
|
||||
"NAME=%s", m->name,
|
||||
"LEADER="PID_FMT, m->leader.pid,
|
||||
LOG_MESSAGE_ID(SD_MESSAGE_MACHINE_START_STR),
|
||||
LOG_ITEM("NAME=%s", m->name),
|
||||
LOG_ITEM("LEADER="PID_FMT, m->leader.pid),
|
||||
LOG_MESSAGE("New machine %s.", m->name));
|
||||
|
||||
if (!dual_timestamp_is_set(&m->timestamp))
|
||||
@@ -586,9 +586,9 @@ int machine_finalize(Machine *m) {
|
||||
|
||||
if (m->started) {
|
||||
log_struct(LOG_INFO,
|
||||
"MESSAGE_ID=" SD_MESSAGE_MACHINE_STOP_STR,
|
||||
"NAME=%s", m->name,
|
||||
"LEADER="PID_FMT, m->leader.pid,
|
||||
LOG_MESSAGE_ID(SD_MESSAGE_MACHINE_STOP_STR),
|
||||
LOG_ITEM("NAME=%s", m->name),
|
||||
LOG_ITEM("LEADER="PID_FMT, m->leader.pid),
|
||||
LOG_MESSAGE("Machine %s terminated.", m->name));
|
||||
|
||||
m->stopping = true; /* The machine is supposed to be going away. Don't try to kill it. */
|
||||
|
||||
Reference in New Issue
Block a user