X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flog.h;h=cf9f7fa5696cd8009a0e12270e21d1348e331032;hb=133176702a03e5f6264f35c403dd7720d9e05c3f;hp=9942e3e9a05a21ea3dfca659080e2c1faf51d6bd;hpb=4d8a7798e7f12c6400495cbc4d0ad57ed20ce90a;p=elogind.git diff --git a/src/log.h b/src/log.h index 9942e3e9a..cf9f7fa56 100644 --- a/src/log.h +++ b/src/log.h @@ -24,17 +24,18 @@ #include #include +#include #include "macro.h" -/* If set to SYSLOG and /dev/log can not be opened we fall back to - * KSMG. If KMSG fails, we fall back to CONSOLE */ typedef enum LogTarget{ LOG_TARGET_CONSOLE, LOG_TARGET_KMSG, + LOG_TARGET_JOURNAL, + LOG_TARGET_JOURNAL_OR_KMSG, LOG_TARGET_SYSLOG, LOG_TARGET_SYSLOG_OR_KMSG, - LOG_TARGET_AUTO, /* console if stderr is tty, SYSLOG_OR_KMSG otherwise */ + LOG_TARGET_AUTO, /* console if stderr is tty, JOURNAL_OR_KMSG otherwise */ LOG_TARGET_NULL, _LOG_TARGET_MAX, _LOG_TARGET_INVALID = -1 @@ -60,6 +61,7 @@ void log_close(void); void log_forget_fds(void); void log_close_syslog(void); +void log_close_journal(void); void log_close_kmsg(void); void log_close_console(void); @@ -72,11 +74,16 @@ int log_meta( const char *func, const char *format, ...) _printf_attr_(5,6); -_noreturn_ void log_assert( +int log_metav( + int level, const char*file, int line, const char *func, - const char *format, ...) _printf_attr_(4,5); + const char *format, + va_list ap); + +_noreturn_ void log_assert_failed(const char *text, const char *file, int line, const char *func); +_noreturn_ void log_assert_failed_unreachable(const char *text, const char *file, int line, const char *func); /* This modifies the buffer passed! */ int log_dump_internal(