From 2950f5da55af16c8efd1ca24f714e9d69c602503 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 8 Jan 2019 08:08:13 -0500 Subject: lib: Add '--command-log-always` to all daemons startup Add 'no log commands' cli and at the same time add a --command-log-always to the daemon startup cli. If --command-log-always is specified then all commands are auto-logged and the 'no log commands' form of the command is now ignored. Signed-off-by: Donald Sharp --- lib/libfrr.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/libfrr.c') diff --git a/lib/libfrr.c b/lib/libfrr.c index 15de96feee..194a1d9bd4 100644 --- a/lib/libfrr.c +++ b/lib/libfrr.c @@ -94,6 +94,7 @@ static void opt_extend(const struct optspec *os) #define OPTION_LOGLEVEL 1004 #define OPTION_TCLI 1005 #define OPTION_DB_FILE 1006 +#define OPTION_LOGGING 1007 static const struct option lo_always[] = { {"help", no_argument, NULL, 'h'}, @@ -105,6 +106,7 @@ static const struct option lo_always[] = { {"log", required_argument, NULL, OPTION_LOG}, {"log-level", required_argument, NULL, OPTION_LOGLEVEL}, {"tcli", no_argument, NULL, OPTION_TCLI}, + {"command-log-always", no_argument, NULL, OPTION_LOGGING}, {NULL}}; static const struct optspec os_always = { "hvdM:", @@ -496,6 +498,9 @@ static int frr_opt(int opt) case OPTION_LOGLEVEL: di->early_loglevel = optarg; break; + case OPTION_LOGGING: + di->log_always = true; + break; default: return 1; } @@ -648,7 +653,7 @@ struct thread_master *frr_init(void) else cmd_init(1); - vty_init(master); + vty_init(master, di->log_always); memory_init(); log_ref_init(); -- cgit v1.2.3