diff --git a/man/rules/meson.build b/man/rules/meson.build
index 3b52d33e37..a15a30f67a 100644
--- a/man/rules/meson.build
+++ b/man/rules/meson.build
@@ -643,9 +643,14 @@ manpages = [
'3',
['SD_JOURNAL_SUPPRESS_LOCATION',
'sd_journal_perror',
+ 'sd_journal_perror_with_location',
+ 'sd_journal_print_with_location',
'sd_journal_printv',
+ 'sd_journal_printv_with_location',
'sd_journal_send',
- 'sd_journal_sendv'],
+ 'sd_journal_send_with_location',
+ 'sd_journal_sendv',
+ 'sd_journal_sendv_with_location'],
''],
['sd_journal_query_unique',
'3',
diff --git a/man/sd_journal_print.xml b/man/sd_journal_print.xml
index f6973087f3..84adab5c7b 100644
--- a/man/sd_journal_print.xml
+++ b/man/sd_journal_print.xml
@@ -22,6 +22,12 @@
sd_journal_sendv
sd_journal_perror
SD_JOURNAL_SUPPRESS_LOCATION
+ sd_journal_print_with_location
+ sd_journal_printv_with_location
+ sd_journal_send_with_location
+ sd_journal_sendv_with_location
+ sd_journal_perror_with_location
+
Submit log entries to the journal
@@ -60,6 +66,51 @@
const char *message
+
+ int sd_journal_print_with_location
+ const char *file
+ const char *line
+ const char *func
+ int priority
+ const char *format
+ …
+
+
+
+ int sd_journal_printv_with_location
+ int priority
+ const char *file
+ const char *line
+ const char *func
+ const char *format
+ va_list ap
+
+
+
+ int sd_journal_send_with_location
+ const char *file
+ const char *line
+ const char *func
+ const char *format
+ …
+
+
+
+ int sd_journal_sendv_with_location
+ const char *file
+ const char *line
+ const char *func
+ const struct iovec *iov
+ int n
+
+
+
+ int sd_journal_perror_with_location
+ const char *file
+ const char *line
+ const char *func
+ const char *message
+
@@ -136,11 +187,20 @@ sd_journal_send("MESSAGE=Hello World, this is PID %lu!", (unsigned long) getpid(
"PRIORITY=%i", LOG_INFO,
NULL);
- Note that these calls implicitly add fields for the source
- file, function name and code line where invoked. This is
- implemented with macros. If this is not desired, it can be turned
- off by defining SD_JOURNAL_SUPPRESS_LOCATION before including
- sd-journal.h.
+ Note that these calls implicitly add fields for the source file, function name and code line where
+ invoked. This is implemented with macros. If this is not desired, it can be turned off by defining
+ SD_JOURNAL_SUPPRESS_LOCATION before including sd-journal.h.
+
+
+ sd_journal_print_with_location,
+ sd_journal_printv_with_location, sd_journal_send_with_location,
+ sd_journal_sendv_with_location, and
+ sd_journal_perror_with_location are similar to their counterparts without
+ _with_location, but accept additional parameters to explicitly set the source file
+ name, function, and line. Those arguments must contain valid journal entries including the variable name,
+ e.g. CODE_FILE=src/foo.c, CODE_LINE=666,
+ CODE_FUNC=myfunc. These variants are primarily useful when writing custom wrappers,
+ for example in bindings for a different language.
syslog3
and sd_journal_print() may
@@ -163,9 +223,9 @@ sd_journal_send("MESSAGE=Hello World, this is PID %lu!", (unsigned long) getpid(
Return Value
- The five calls return 0 on success or a negative errno-style error code. The errno3 variable itself is
- not altered.
+ The ten functions return 0 on success or a negative errno-style error code. The
+ errno3
+ variable itself is not altered.
If
systemd-journald8
@@ -178,15 +238,17 @@ sd_journal_send("MESSAGE=Hello World, this is PID %lu!", (unsigned long) getpid(
- sd_journal_sendv() is "async signal safe" in the meaning of signal-safety7.
+ sd_journal_sendv() and sd_journal_sendv_with_location()
+ are "async signal safe" in the meaning of
+ signal-safety7.
sd_journal_print,
sd_journal_printv,
- sd_journal_send, and
- sd_journal_perror are
- not async signal safe.
+ sd_journal_send,
+ sd_journal_perror,
+ and their counterparts with _with_location
+ are not async signal safe.