]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Logging: exposing vlog() to log va_lists
authorMaria Matejka <mq@ucw.cz>
Thu, 14 Nov 2024 20:20:49 +0000 (21:20 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Mon, 2 Dec 2024 03:27:30 +0000 (04:27 +0100)
client/util.c
lib/birdlib.h
sysdep/unix/log.c

index 1d83e518dc083ad65fe2facd315dad7d033ba1b8..3a78a7c42b63ed0faf0db10cd98ac6ed0e9b1903 100644 (file)
@@ -17,7 +17,7 @@
 /* Client versions of logging functions */
 
 static void
-vlog(const char *msg, va_list args)
+vlog_cli(const char *msg, va_list args)
 {
   char buf[1024];
 
@@ -38,7 +38,7 @@ bug(const char *msg, ...)
   va_start(args, msg);
   cleanup();
   fputs("Internal error: ", stderr);
-  vlog(msg, args);
+  vlog_cli(msg, args);
   vfprintf(stderr, msg, args);
   va_end(args);
   exit(1);
@@ -51,7 +51,7 @@ die(const char *msg, ...)
 
   va_start(args, msg);
   cleanup();
-  vlog(msg, args);
+  vlog_cli(msg, args);
   va_end(args);
   exit(1);
 }
index 8852b609a61ee8ec7bfcc8c5c131658c370c656e..4fea3f9f0c30a0e27f7fa8e742e37213405fb228 100644 (file)
@@ -10,6 +10,7 @@
 #define _BIRD_BIRDLIB_H_
 
 #include "lib/alloca.h"
+#include <stdarg.h>
 
 /* Ugly structure offset handling macros */
 
@@ -159,6 +160,7 @@ void log_msg(const char *msg, ...);
 void log_rl(struct tbf *rl, const char *msg, ...);
 void die(const char *msg, ...) NORET;
 void bug(const char *msg, ...) NORET;
+void vlog(int class, const char *msg, va_list args);
 
 #define L_DEBUG "\001"                 /* Debugging messages */
 #define L_TRACE "\002"                 /* Protocol tracing */
index 613a6aa54c914ddab7cd47fbbcd5293c571e9d98..6c7cac54076d74ddce9f8d377a505348f3dceb70 100644 (file)
@@ -274,7 +274,7 @@ log_commit(int class, buffer *buf)
 
 int buffer_vprint(buffer *buf, const char *fmt, va_list args);
 
-static void
+void
 vlog(int class, const char *msg, va_list args)
 {
   buffer buf;