Skip to content

Commit

Permalink
logger: Define SD_JOURNAL_SUPPRESS_LOCATION.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
YmrDtnJu committed Jul 7, 2018
1 parent e6dfbd7 commit 03190b7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions misc-utils/logger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 03190b7

Please sign in to comment.