summaryrefslogtreecommitdiffstats
path: root/misc-utils/logger.c
diff options
context:
space:
mode:
authorYmrDtnJu2018-07-07 20:11:46 +0200
committerYmrDtnJu2018-07-07 20:11:46 +0200
commit03190b73f00c3c4fb7d3f2da0ba35ac3c9fe2e40 (patch)
tree336125e6fa435a44ee6cdf625c0acf407a687e6b /misc-utils/logger.c
parentlibfdisk: reduce number of asprintf() calls, check return value (diff)
downloadkernel-qcow2-util-linux-03190b73f00c3c4fb7d3f2da0ba35ac3c9fe2e40.tar.gz
kernel-qcow2-util-linux-03190b73f00c3c4fb7d3f2da0ba35ac3c9fe2e40.tar.xz
kernel-qcow2-util-linux-03190b73f00c3c4fb7d3f2da0ba35ac3c9fe2e40.zip
logger: Define SD_JOURNAL_SUPPRESS_LOCATION.
The normal journald functions add the location in the C source code files to the log messages. This is nice for a big C based project, but logger is used in scripts so it would be more useful to let users specify the location in the script by adding the CODE_FUNC, CODE_FILE and CODE_FILE fields to the log message. It is already possible to do this, but it will result in two versions of these fields: one for the location in logger.c and one for the location in the script.
Diffstat (limited to 'misc-utils/logger.c')
-rw-r--r--misc-utils/logger.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/misc-utils/logger.c b/misc-utils/logger.c
index 846c85273..ebdc56ec2 100644
--- a/misc-utils/logger.c
+++ b/misc-utils/logger.c
@@ -68,6 +68,7 @@
#include <syslog.h>
#ifdef HAVE_LIBSYSTEMD
+# define SD_JOURNAL_SUPPRESS_LOCATION
# include <systemd/sd-daemon.h>
# include <systemd/sd-journal.h>
#endif