X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flog.h;h=3283808ff88cbdc3c201d06a96693e598cc4c94b;hb=b8b5e648cacc8d73c55fdffbb3466ecd8146131a;hp=6ab07a5422224c664196d5ad10dc3a2b44cdca9a;hpb=5ba081b0fb02380cee4c2ff5bc7e05f869eb8415;p=elogind.git diff --git a/src/log.h b/src/log.h index 6ab07a542..3283808ff 100644 --- a/src/log.h +++ b/src/log.h @@ -24,6 +24,7 @@ #include #include +#include #include "macro.h" @@ -42,6 +43,7 @@ typedef enum LogTarget{ void log_set_target(LogTarget target); void log_set_max_level(int level); +void log_set_facility(int facility); int log_set_target_from_string(const char *e); int log_set_max_level_from_string(const char *e); @@ -73,11 +75,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( @@ -87,7 +94,7 @@ int log_dump_internal( const char *func, char *buffer); -#define log_full(level, ...) log_meta(level, __FILE__, __LINE__, __func__, __VA_ARGS__) +#define log_full(level, ...) log_meta(level, __FILE__, __LINE__, __func__, __VA_ARGS__) #define log_debug(...) log_meta(LOG_DEBUG, __FILE__, __LINE__, __func__, __VA_ARGS__) #define log_info(...) log_meta(LOG_INFO, __FILE__, __LINE__, __func__, __VA_ARGS__)