Output logging to stderr instead of stdout
authorJonathan Dieter <jdieter@gmail.com>
Mon, 21 May 2018 18:34:13 +0000 (21:34 +0300)
committerJonathan Dieter <jdieter@gmail.com>
Mon, 21 May 2018 18:34:13 +0000 (21:34 +0300)
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
src/lib/log.c

index 6409f34d139e50c37e924fceeff9f2a61a42fca0..3174751ff5517db8695c25dd897dfc5229c1e2c8 100644 (file)
@@ -27,6 +27,7 @@
 #include <stdio.h>
 #include <stdint.h>
 #include <stdarg.h>
+#include <unistd.h>
 #include <zck.h>
 
 #include "zck_private.h"
@@ -41,7 +42,7 @@ void PUBLIC zck_log(zck_log_type lt, const char *format, ...) {
     if(lt >= log_level) {
         va_list args;
         va_start(args, format);
-        vprintf(format, args);
+        vdprintf(STDERR_FILENO, format, args);
         va_end(args);
     }
 }