]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/log.h
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
[mirror_frr.git] / lib / log.h
index 711308a47676e9026ead3a441d3a992d38f446e8..be1d9fb5922896b083a2009a4f2fb577a833b5b3 100644 (file)
--- a/lib/log.h
+++ b/lib/log.h
@@ -24,6 +24,7 @@
 
 #include <syslog.h>
 #include <stdint.h>
+#include <stdbool.h>
 #include <stdio.h>
 
 /* Here is some guidance on logging levels to use:
@@ -54,6 +55,8 @@ typedef enum {
 } zlog_dest_t;
 #define ZLOG_NUM_DESTS         (ZLOG_DEST_FILE+1)
 
+extern bool zlog_startup_stderr;
+
 /* Message structure. */
 struct message {
        int key;
@@ -82,6 +85,15 @@ extern void zlog_info(const char *format, ...) PRINTF_ATTRIBUTE(1, 2);
 extern void zlog_notice(const char *format, ...) PRINTF_ATTRIBUTE(1, 2);
 extern void zlog_debug(const char *format, ...) PRINTF_ATTRIBUTE(1, 2);
 
+/* For logs which have error codes associated with them */
+#define flog_err(ferr_id, format, ...)                                        \
+       zlog_err("[EC %"PRIu32"] " format, ferr_id, ##__VA_ARGS__)
+#define flog_err_sys(ferr_id, format, ...)                                     \
+       flog_err(ferr_id, format, ##__VA_ARGS__)
+#define flog_warn(ferr_id, format, ...)                                        \
+       zlog_warn("[EC %"PRIu32"] " format, ferr_id, ##__VA_ARGS__)
+
+
 extern void zlog_thread_info(int log_level);
 
 /* Set logging level for the given destination.  If the log_level
@@ -109,7 +121,7 @@ extern void zlog_signal(int signo, const char *action
                        ,
                        siginfo_t *siginfo, void *program_counter
 #endif
-);
+                       );
 
 /* Log a backtrace. */
 extern void zlog_backtrace(int priority);
@@ -143,7 +155,7 @@ struct timestamp_control {
        int precision;                  /* configuration parameter */
        int already_rendered;           /* should be initialized to 0 */
        char buf[QUAGGA_TIMESTAMP_LEN]; /* will contain the rendered timestamp
-                                        */
+                                          */
 };
 
 /* Defines for use in command construction: */