From e2cc6eca73cd1df8be552d7c23f9ff3d69c06f1e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 28 Nov 2014 02:05:14 +0100 Subject: log: fix order of log_unit_struct() to match other logging calls Also, while we are at it, introduce some syntactic sugar for creating ERRNO= and MESSAGE= structured logging fields. --- src/core/mount.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/core/mount.c') diff --git a/src/core/mount.c b/src/core/mount.c index 36375f65bc..d34699bca8 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -823,12 +823,12 @@ void warn_if_dir_nonempty(const char *unit, const char* where) { if (r > 0) return; else if (r == 0) - log_unit_struct(LOG_NOTICE, - unit, - "MESSAGE=%s: Directory %s to mount over is not empty, mounting anyway.", - unit, where, + log_unit_struct(unit, + LOG_NOTICE, + LOG_MESSAGE_ID(SD_MESSAGE_OVERMOUNTING), + LOG_MESSAGE("%s: Directory %s to mount over is not empty, mounting anyway.", + unit, where), "WHERE=%s", where, - MESSAGE_ID(SD_MESSAGE_OVERMOUNTING), NULL); else log_unit_warning(unit, @@ -840,12 +840,12 @@ static int fail_if_symlink(const char *unit, const char* where) { assert(where); if (is_symlink(where) > 0) { - log_unit_struct(LOG_WARNING, - unit, - "MESSAGE=%s: Mount on symlink %s not allowed.", - unit, where, + log_unit_struct(unit, + LOG_ERR, + LOG_MESSAGE_ID(SD_MESSAGE_OVERMOUNTING), + LOG_MESSAGE("%s: Mount on symlink %s not allowed.", + unit, where), "WHERE=%s", where, - MESSAGE_ID(SD_MESSAGE_OVERMOUNTING), NULL); return -ELOOP; -- cgit v1.2.3-54-g00ecf