summaryrefslogtreecommitdiff
path: root/log.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-05-15 17:25:08 +0200
committerLennart Poettering <lennart@poettering.net>2010-05-15 17:25:08 +0200
commit843d2643849a1ec63034012c8fe50bfaad23190b (patch)
treec073b19d9eb4a164b41c70e60fdcbd2d5e9b9bbf /log.h
parentd9a76d8f860c4ee19c4aa0df685889d058f4c5cb (diff)
log: rework logging logic so that we don't keep /dev/console open
Diffstat (limited to 'log.h')
-rw-r--r--log.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/log.h b/log.h
index 0fc1834f6f..6df1d59961 100644
--- a/log.h
+++ b/log.h
@@ -26,10 +26,13 @@
#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_SYSLOG,
LOG_TARGET_KMSG,
+ LOG_TARGET_SYSLOG,
+ LOG_TARGET_SYSLOG_OR_KMSG,
_LOG_TARGET_MAX,
_LOG_TARGET_INVALID = -1
} LogTarget;
@@ -43,14 +46,15 @@ int log_set_max_level_from_string(const char *e);
LogTarget log_get_target(void);
int log_get_max_level(void);
-void log_close_kmsg(void);
-int log_open_kmsg(void);
+int log_open(void);
+
void log_close_syslog(void);
-int log_open_syslog(void);
+void log_close_kmsg(void);
+void log_close_console(void);
void log_parse_environment(void);
-void log_meta(
+int log_meta(
int level,
const char*file,
int line,