chiark / gitweb /
sysusers: fix selinux context of backup files
[elogind.git] / src / shared / log.h
index ac20a985c5eec1248337de09ef21dcc68819e61a..794af7be6af64aa004424d01131e558d418546bc 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <syslog.h>
 #include <stdbool.h>
 #include <stdarg.h>
+#include <syslog.h>
+#include <sys/signalfd.h>
 #include <errno.h>
 
 #include "macro.h"
@@ -51,7 +52,9 @@ int log_set_target_from_string(const char *e);
 int log_set_max_level_from_string(const char *e);
 
 void log_show_color(bool b);
+bool log_get_show_color(void) _pure_;
 void log_show_location(bool b);
+bool log_get_show_location(void) _pure_;
 
 int log_show_color_from_string(const char *e);
 int log_show_location_from_string(const char *e);
@@ -124,13 +127,19 @@ int log_dump_internal(
                 const char *func,
                 char *buffer);
 
-_noreturn_ void log_assert_failed(
+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);
 
-_noreturn_ void log_assert_failed_unreachable(
+void log_assert_failed_return(
                 const char *text,
                 const char *file,
                 int line,
@@ -139,7 +148,7 @@ _noreturn_ void log_assert_failed_unreachable(
 #define log_full(level, ...) \
 do { \
         if (log_get_max_level() >= (level)) \
-                log_meta(LOG_INFO, __FILE__, __LINE__, __func__, __VA_ARGS__); \
+                log_meta((level), __FILE__, __LINE__, __func__, __VA_ARGS__); \
 } while (0)
 
 #define log_debug(...)   log_full(LOG_DEBUG,   __VA_ARGS__)
@@ -161,3 +170,5 @@ const char *log_target_to_string(LogTarget target) _const_;
 LogTarget log_target_from_string(const char *s) _pure_;
 
 #define MESSAGE_ID(x) "MESSAGE_ID=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL(x)
+
+void log_received_signal(int level, const struct signalfd_siginfo *si);