]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/log-stream.c
Configure: Turned off -Winline
[libucw.git] / ucw / log-stream.c
index 5af9f3e6581ad264797e64c566ba0573db40f5d8..5dbd71ff1c5bf63b3a090dc0d6693700eb9b4244 100644 (file)
@@ -2,16 +2,16 @@
  *     UCW Library -- Logging: Management of Log Streams
  *
  *     (c) 2008 Tomas Gavenciak <gavento@ucw.cz>
- *     (c) 2009 Martin Mares <mj@ucw.cz>
+ *     (c) 2009--2012 Martin Mares <mj@ucw.cz>
  *
  *     This software may be freely distributed and used according to the terms
  *     of the GNU Lesser General Public License.
  */
 
-#include "ucw/lib.h"
-#include "ucw/log.h"
-#include "ucw/log-internal.h"
-#include "ucw/simple-lists.h"
+#include <ucw/lib.h>
+#include <ucw/log.h>
+#include <ucw/log-internal.h>
+#include <ucw/simple-lists.h>
 
 #include <string.h>
 
@@ -170,6 +170,15 @@ log_set_format(struct log_stream *ls, uns mask, uns data)
     log_set_format(i->p, mask, data);
 }
 
+void
+log_set_default_stream(struct log_stream *ls)
+{
+  struct log_stream *def = log_stream_by_flags(0);
+  log_rm_substream(def, NULL);
+  log_add_substream(def, ls);
+  log_close_stream(ls);
+}
+
 /*** Registry of type names ***/
 
 int log_register_type(const char *name)