summaryrefslogtreecommitdiff
path: root/src/systemd/sd-journal.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-07-31 16:09:01 +0200
committerLennart Poettering <lennart@poettering.net>2012-08-01 19:53:23 +0200
commit18c7ed186be28800a2eeb37ad31c9c44480d3d9c (patch)
tree71d39423e738bcd866aff16269ea925c3c7eab17 /src/systemd/sd-journal.h
parent4d9909c93e9c58789c71b34555a1908307c6849e (diff)
downloadsystemd-18c7ed186be28800a2eeb37ad31c9c44480d3d9c.tar.gz
journal: add sd_journal_perror() to API
Diffstat (limited to 'src/systemd/sd-journal.h')
-rw-r--r--src/systemd/sd-journal.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/systemd/sd-journal.h b/src/systemd/sd-journal.h
index e70f575ce9..de1c8f38f2 100644
--- a/src/systemd/sd-journal.h
+++ b/src/systemd/sd-journal.h
@@ -41,12 +41,14 @@ int sd_journal_print(int priority, const char *format, ...) __attribute__ ((form
int sd_journal_printv(int priority, const char *format, va_list ap);
int sd_journal_send(const char *format, ...) __attribute__((sentinel));
int sd_journal_sendv(const struct iovec *iov, int n);
+int sd_journal_perror(const char *message);
/* Used by the macros below. Don't call this directly. */
int sd_journal_print_with_location(int priority, const char *file, const char *line, const char *func, const char *format, ...) __attribute__ ((format (printf, 5, 6)));
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, ...) __attribute__((sentinel));
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);
/* implicitly add code location to messages sent, if this is enabled */
#ifndef SD_JOURNAL_SUPPRESS_LOCATION
@@ -58,6 +60,7 @@ int sd_journal_sendv_with_location(const char *file, const char *line, const cha
#define sd_journal_printv(priority, format, ap) sd_journal_printv_with_location(priority, "CODE_FILE=" __FILE__, "CODE_LINE=" _sd_STRINGIFY(__LINE__), __func__, format, ap)
#define sd_journal_send(...) sd_journal_send_with_location("CODE_FILE=" __FILE__, "CODE_LINE=" _sd_STRINGIFY(__LINE__), __func__, __VA_ARGS__)
#define sd_journal_sendv(iovec, n) sd_journal_sendv_with_location("CODE_FILE=" __FILE__, "CODE_LINE=" _sd_STRINGIFY(__LINE__), __func__, iovec, n)
+#define sd_journal_perror(message) sd_journal_perror_with_location("CODE_FILE=" __FILE__, "CODE_LINE=" _sd_STRINGIFY(__LINE__), __func__, message)
#endif