]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: add hook for `show logging` CLI
authorDavid Lamparter <equinox@diac24.net>
Thu, 8 Apr 2021 12:29:18 +0000 (14:29 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Fri, 18 Jun 2021 18:56:53 +0000 (20:56 +0200)
... so additional targets can print their state.

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

index aa1888a9e9670a6d3e787311ca3a95525110c810..7057a06c512b7180cebf489f13638a58381b7682 100644 (file)
@@ -34,6 +34,7 @@
 #define ZLOG_MAXLVL(a, b) MAX(a, b)
 
 DEFINE_HOOK(zlog_rotate, (), ());
+DEFINE_HOOK(zlog_cli_show, (struct vty * vty), (vty));
 
 static const int log_default_lvl = LOG_DEBUG;
 
@@ -194,6 +195,8 @@ DEFUN_NOSH (show_logging,
        vty_out(vty, "Record priority: %s\n",
                (zt_file.record_priority ? "enabled" : "disabled"));
        vty_out(vty, "Timestamp precision: %d\n", zt_file.ts_subsec);
+
+       hook_call(zlog_cli_show, vty);
        return CMD_SUCCESS;
 }
 
index f0fb7d3dba0235db5be51355d048bf15fe79611a..913ff5f88e8a002c4e408ed31a1738d4110e4b29 100644 (file)
@@ -37,6 +37,8 @@ extern void log_show_syslog(struct vty *vty);
 DECLARE_HOOK(zlog_rotate, (), ());
 extern void zlog_rotate(void);
 
+DECLARE_HOOK(zlog_cli_show, (struct vty * vty), (vty));
+
 #ifdef __cplusplus
 }
 #endif