chiark / gitweb /
copy: adjust directory times after writing to the directory
[elogind.git] / src / basic / log.h
index e6314e82079947275c132a3593db4b6c9ef9f621..899474daad8148b5e89b2e6d5d163ea19c1a8b59 100644 (file)
@@ -1,5 +1,3 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
 #pragma once
 
 /***
@@ -26,6 +24,7 @@
 #include <stdbool.h>
 #include <stdlib.h>
 #include <sys/signalfd.h>
+#include <sys/socket.h>
 #include <syslog.h>
 
 #include "sd-id128.h"
@@ -36,8 +35,7 @@ typedef enum LogTarget{
         LOG_TARGET_CONSOLE,
         LOG_TARGET_CONSOLE_PREFIXED,
         LOG_TARGET_KMSG,
-/// elogind does not support logging to systemd-journald
-#if 0
+#if 0 /// elogind does not support logging to systemd-journald
         LOG_TARGET_JOURNAL,
         LOG_TARGET_JOURNAL_OR_KMSG,
 #endif // 0
@@ -70,10 +68,13 @@ int log_get_max_level(void) _pure_;
 
 int log_open(void);
 void log_close(void);
-// UNNEEDED void log_forget_fds(void);
-
+#if 0 /// UNNEEDED by elogind
+void log_forget_fds(void);
+#endif // 0
 void log_close_syslog(void);
-// UNNEEDED void log_close_journal(void);
+#if 0 /// UNNEEDED by elogind
+void log_close_journal(void);
+#endif // 0
 void log_close_kmsg(void);
 void log_close_console(void);
 
@@ -130,6 +131,15 @@ int log_oom_internal(
                 int line,
                 const char *func);
 
+int log_format_iovec(
+                struct iovec *iovec,
+                unsigned iovec_len,
+                unsigned *n,
+                bool newline_separator,
+                int error,
+                const char *format,
+                va_list ap);
+
 /* This modifies the buffer passed! */
 int log_dump_internal(
                 int level,
@@ -215,9 +225,11 @@ LogTarget log_target_from_string(const char *s) _pure_;
 #define LOG_MESSAGE(fmt, ...) "MESSAGE=" fmt, ##__VA_ARGS__
 #define LOG_MESSAGE_ID(x) "MESSAGE_ID=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL(x)
 
-// UNNEEDED void log_received_signal(int level, const struct signalfd_siginfo *si);
+#if 0 /// UNNEEDED by elogind
+void log_received_signal(int level, const struct signalfd_siginfo *si);
 
-// UNNEEDED void log_set_upgrade_syslog_to_journal(bool b);
+void log_set_upgrade_syslog_to_journal(bool b);
+#endif // 0
 
 int log_syntax_internal(
                 const char *unit,
@@ -247,5 +259,4 @@ int log_syntax_internal(
                         log_syntax_internal(unit, _level, config_file, config_line, 0, __FILE__, __LINE__, __func__, \
                                             "String is not UTF-8 clean, ignoring assignment: %s", strna(_p)); \
                 }                                                       \
-                -EINVAL;                                                \
         })