fix stdout log message duplicates

Sun, 27 Nov 2022 10:20:10 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 27 Nov 2022 10:20:10 +0100
changeset 442
05c2b62448b1
parent 441
797aeb31a2c6
child 443
ef3c8a0e1fee

fix stdout log message duplicates

src/server/daemon/log.c file | annotate | diff | comparison | revisions
src/server/daemon/log.h file | annotate | diff | comparison | revisions
--- a/src/server/daemon/log.c	Sun Nov 27 10:07:37 2022 +0100
+++ b/src/server/daemon/log.c	Sun Nov 27 10:20:10 2022 +0100
@@ -142,7 +142,7 @@
     
     
     is_initialized = 1;
-    
+       
     /* if ui_buffer is not NULL, write it to the log file */
     if(ui_buffer) {
         size_t len = ui_buffer->length;
@@ -158,9 +158,7 @@
     return 0;
 }
 
-void log_uninitialized_writeln(char *str, size_t len) {
-    printf("%.*s\n", (int)len, str);
-    
+void log_uninitialized_writeln(char *str, size_t len) {  
     if(ui_buffer == NULL) {
         ui_buffer = sbuf_new(1024);
         if(ui_buffer == NULL) {
--- a/src/server/daemon/log.h	Sun Nov 27 10:07:37 2022 +0100
+++ b/src/server/daemon/log.h	Sun Nov 27 10:20:10 2022 +0100
@@ -62,6 +62,7 @@
     log_writefunc write;
     void *cookie;
 } LogDup;
+
 // server logging
 int init_log_file(LogConfig *cfg);
 

mercurial