summaryrefslogtreecommitdiffstats
path: root/ldpd/log.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:56:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:56:24 +0000
commit54de8bbe36d7d968c6367939277942518bd4e11f (patch)
tree924f8c16d9c8831679f355b88c620b9b356c9d5a /ldpd/log.h
parentAdding debian version 10.0.1-0.1. (diff)
downloadfrr-54de8bbe36d7d968c6367939277942518bd4e11f.tar.xz
frr-54de8bbe36d7d968c6367939277942518bd4e11f.zip
Merging upstream version 10.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ldpd/log.h')
-rw-r--r--ldpd/log.h43
1 files changed, 22 insertions, 21 deletions
diff --git a/ldpd/log.h b/ldpd/log.h
index 641ad8a..aa6f700 100644
--- a/ldpd/log.h
+++ b/ldpd/log.h
@@ -8,29 +8,30 @@
#ifndef LOG_H
#define LOG_H
-#include <stdarg.h>
+#include "log.h"
+#include "assert.h"
extern const char *log_procname;
-void logit(int, const char *, ...)
- __attribute__((__format__ (printf, 2, 3)));
-void vlog(int, const char *, va_list)
- __attribute__((__format__ (printf, 2, 0)));
-void log_warn(const char *, ...)
- __attribute__((__format__ (printf, 1, 2)));
-void log_warnx(const char *, ...)
- __attribute__((__format__ (printf, 1, 2)));
-void log_info(const char *, ...)
- __attribute__((__format__ (printf, 1, 2)));
-void log_notice(const char *, ...)
- __attribute__((__format__ (printf, 1, 2)));
-void log_debug(const char *, ...)
- __attribute__((__format__ (printf, 1, 2)));
-void fatal(const char *)
- __attribute__ ((noreturn))
- __attribute__((__format__ (printf, 1, 0)));
-void fatalx(const char *)
- __attribute__ ((noreturn))
- __attribute__((__format__ (printf, 1, 0)));
+#define log_warnx zlog_err /* yes this is poorly named */
+#define log_warn zlog_warn
+#define log_info zlog_info
+#define log_notice zlog_notice /* not used anywhere */
+#define log_debug zlog_debug
+
+#define fatal(msg) \
+ do { \
+ assertf(0, "fatal in %s: %pSQq (%m)", log_procname, \
+ (const char *)msg); \
+ __builtin_unreachable(); \
+ } while (0) \
+ /* end */
+#define fatalx(msg) \
+ do { \
+ assertf(0, "fatal in %s: %pSQq", log_procname, \
+ (const char *)msg); \
+ __builtin_unreachable(); \
+ } while (0) \
+ /* end */
#endif /* LOG_H */