]> mj.ucw.cz Git - libucw.git/commitdiff
Logging: Resurrected testing of log-conf
authorMartin Mares <mj@ucw.cz>
Thu, 12 Feb 2015 15:50:53 +0000 (16:50 +0100)
committerMartin Mares <mj@ucw.cz>
Thu, 12 Feb 2015 15:50:53 +0000 (16:50 +0100)
ucw/log-conf-test.cf
ucw/log-conf.c

index f1d2b20a9f1947d96fb4c8eecbc0647e3c09100f..828f6e323055c645604fa68b934ec322e0a4b233 100644 (file)
@@ -1,4 +1,4 @@
-Include cf/libucw
+Include etc/libucw
 
 Logging {
 
index d809c11d00145f9725cce7eb9222d7120994f86a..72bbefd8f490d2be250360f309d4fb5e39fad95c 100644 (file)
@@ -20,6 +20,8 @@
 #include <syslog.h>
 #include <sys/time.h>
 
+#ifndef TEST
+
 /*** Configuration of streams ***/
 
 struct stream_config {
@@ -339,7 +341,7 @@ log_configured(const char *name)
   log_set_default_stream(log_new_configured(name));
 }
 
-#ifdef TEST
+#else /* TEST */
 
 #include <unistd.h>
 #include <ucw/getopt.h>
@@ -353,6 +355,7 @@ int main(int argc, char **argv)
 
   int type = log_register_type("foo");
   struct log_stream *ls = log_new_configured("combined");
+  log_drop_stderr();
   for (uint i=0; i<10; i++)
     {
       msg(L_INFO | ls->regnum | type, "Hello, universe!");