]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/log.h
Compatibility with GCC < 4.0 is not needed any longer
[libucw.git] / ucw / log.h
index 6ff2d4e56b8d82669dfbadf4848c0691cf3227de..7724c6c07f3bbbe68e83c77183be18e1bf9dfc69 100644 (file)
--- a/ucw/log.h
+++ b/ucw/log.h
@@ -1,7 +1,7 @@
 /*
  *     UCW Library -- Logging
  *
- *     (c) 1997--2009 Martin Mares <mj@ucw.cz>
+ *     (c) 1997--2015 Martin Mares <mj@ucw.cz>
  *     (c) 2008 Tomas Gavenciak <gavento@ucw.cz>
  *
  *     This software may be freely distributed and used according to the terms
@@ -19,6 +19,7 @@
 #define log_close_all ucw_log_close_all
 #define log_close_stream ucw_log_close_stream
 #define log_configured ucw_log_configured
+#define log_drop_stderr ucw_log_drop_stderr
 #define log_find_type ucw_log_find_type
 #define log_new_configured ucw_log_new_configured
 #define log_new_fd ucw_log_new_fd
@@ -258,6 +259,15 @@ void log_switch_disable(void);
 void log_switch_enable(void);          /** Negate the effect of log_switch_disable(). **/
 int log_switch(void);                  /** Switch log files manually. **/
 
+/**
+ * Drop stderr if it is not already redirected to a log file.
+ * This is usually needed in daemons to make sure that the original
+ * stderr does not stay open (stdin and stdout are dropped by our
+ * <<daemon:,daemon setup functions>> automatically). More specifically,
+ * it makes stderr a clone of stdout.
+ **/
+void log_drop_stderr(void);
+
 /***
  * === Logging to syslog
  *