tree-wide: use LOG_MESSAGE() where possible
Also break some long lines for more uniform formatting. No functional change. I went over all log_struct, log_struct_errno, log_unit_struct, log_unit_struct_errno calls, and they seem fine.
This commit is contained in:
+2
-1
@@ -298,7 +298,8 @@ int log_emergency_level(void);
|
||||
|
||||
bool log_on_console(void) _pure_;
|
||||
|
||||
/* Helper to prepare various field for structured logging */
|
||||
/* Helper to wrap the main message in structured logging. The macro doesn't do much,
|
||||
* except to provide visual grouping of the format string and its arguments. */
|
||||
#define LOG_MESSAGE(fmt, ...) "MESSAGE=" fmt, ##__VA_ARGS__
|
||||
|
||||
void log_received_signal(int level, const struct signalfd_siginfo *si);
|
||||
|
||||
@@ -794,7 +794,7 @@ bool valid_user_group_name(const char *u, ValidUserFlags flags) {
|
||||
/* Compare with strict result and warn if result doesn't match */
|
||||
if (FLAGS_SET(flags, VALID_USER_WARN) && !valid_user_group_name(u, 0))
|
||||
log_struct(LOG_NOTICE,
|
||||
"MESSAGE=Accepting user/group name '%s', which does not match strict user/group name rules.", u,
|
||||
LOG_MESSAGE("Accepting user/group name '%s', which does not match strict user/group name rules.", u),
|
||||
"USER_GROUP_NAME=%s", u,
|
||||
"MESSAGE_ID=" SD_MESSAGE_UNSAFE_USER_NAME_STR);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user