]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: make a few log symbols accessible
authorDavid Lamparter <equinox@diac24.net>
Sun, 11 Apr 2021 16:23:16 +0000 (18:23 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Fri, 18 Jun 2021 19:05:21 +0000 (21:05 +0200)
Might've made a few things too many `static` there.

Signed-off-by: David Lamparter <equinox@diac24.net>
lib/log_vty.c
lib/log_vty.h
lib/zlog.h
lib/zlog_targets.c

index 7057a06c512b7180cebf489f13638a58381b7682..cbb8de897646231f2a6fe45a50650c1fa8405d27 100644 (file)
@@ -58,7 +58,7 @@ static struct zlog_cfg_filterfile zt_filterfile = {
        },
 };
 
-static const char *zlog_progname;
+const char *zlog_progname;
 static const char *zlog_protoname;
 
 static const struct facility_map {
@@ -95,7 +95,14 @@ static const char * const zlog_priority[] = {
        "notifications", "informational", "debugging", NULL,
 };
 
-static const char *facility_name(int facility)
+const char *zlog_priority_str(int priority)
+{
+       if (priority > LOG_DEBUG)
+               return "???";
+       return zlog_priority[priority];
+}
+
+const char *facility_name(int facility)
 {
        const struct facility_map *fm;
 
@@ -105,7 +112,7 @@ static const char *facility_name(int facility)
        return "";
 }
 
-static int facility_match(const char *str)
+int facility_match(const char *str)
 {
        const struct facility_map *fm;
 
index 913ff5f88e8a002c4e408ed31a1738d4110e4b29..db46b3cb5b22b0bf48e75c260ce7f11bdf15d1af 100644 (file)
@@ -34,6 +34,9 @@ extern void log_config_write(struct vty *vty);
 extern int log_level_match(const char *s);
 extern void log_show_syslog(struct vty *vty);
 
+extern int facility_match(const char *str);
+extern const char *facility_name(int facility);
+
 DECLARE_HOOK(zlog_rotate, (), ());
 extern void zlog_rotate(void);
 
index ecc30f09b2c2041757bdba4e914ec4d79d31af73..d9c8952ac553c8c6c66a4fa321e610d86867e820 100644 (file)
 extern "C" {
 #endif
 
+DECLARE_MGROUP(LOG);
+
 extern char zlog_prefix[];
 extern size_t zlog_prefixsz;
 extern int zlog_tmpdirfd;
 extern int zlog_instance;
+extern const char *zlog_progname;
 
 struct xref_logmsg {
        struct xref xref;
@@ -274,6 +277,8 @@ extern void zlog_tls_buffer_fini(void);
 /* Enable or disable 'immediate' output - default is to buffer messages. */
 extern void zlog_set_immediate(bool set_p);
 
+extern const char *zlog_priority_str(int priority);
+
 #ifdef __cplusplus
 }
 #endif
index 127de1224043674653c7f55599524155a77d55ac..48785ad298568aae6398ab25e474701216140c7c 100644 (file)
@@ -31,7 +31,6 @@
  * absolute end.
  */
 
-DECLARE_MGROUP(LOG);
 DEFINE_MGROUP_ACTIVEATEXIT(LOG, "logging subsystem");
 
 DEFINE_MTYPE_STATIC(LOG, LOG_FD,        "log file target");