summaryrefslogtreecommitdiffstats
path: root/src/vty/logging_vty.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-09-10 20:58:52 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2018-09-13 15:46:55 +0000
commit7e0686c6b4b456ec4e6e15689694b1bcf96c301f (patch)
tree10d4b6be1e8314d9acd022d953997fafca43bdf0 /src/vty/logging_vty.c
parentba0762d6cbcb8204212d28261e71b57bbc9ba5bc (diff)
logging vty: deprecate the 'everything' keyword
The 'logging level all everything' has not had an effect for some time now. The plan is to bring back its old functionality, but to keep it deprecated and rather define a less confusing name. * Deprecate 'everything'. * Do not write 'everything' during 'write file' or 'show running-config', which we curiously still do until now. BTW, the reason why we need to compose a complete list of categories for the deprecated 'everything' command is explained in detail in the commit log for I3b083f27e3d751ccec258880ae7676e9af959a63 Change-Id: Ib75fedb0572570a61bb34ee729a2af86cf5f16da
Diffstat (limited to 'src/vty/logging_vty.c')
-rw-r--r--src/vty/logging_vty.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c
index 2b001bc9..6758dd22 100644
--- a/src/vty/logging_vty.c
+++ b/src/vty/logging_vty.c
@@ -320,7 +320,7 @@ static void gen_logging_level_cmd_strs(struct cmd_element *cmd,
cmd->doc = doc_str;
}
-/* logging level (all|<categories>) (everything|debug|...|fatal) */
+/* logging level (all|<categories>) (debug|...|fatal) */
DEFUN(logging_level,
logging_level_cmd,
NULL, /* cmdstr is dynamically set in logging_vty_add_cmds(). */
@@ -338,11 +338,6 @@ DEFUN(logging_level,
return CMD_WARNING;
}
- if (strcmp(argv[1], "everything") == 0) { /* FIXME: remove this check once 'everything' is phased out */
- vty_out(vty, "%% Ignoring deprecated logging level %s%s", argv[1], VTY_NEWLINE);
- return CMD_SUCCESS;
- }
-
/* Check for special case where we want to set global log level */
if (!strcmp(argv[0], "all")) {
log_set_log_level(tgt, level);
@@ -360,6 +355,15 @@ DEFUN(logging_level,
return CMD_SUCCESS;
}
+/* logging level (all|<categories>) everything */
+DEFUN_DEPRECATED(deprecated_logging_level_everything, deprecated_logging_level_everything_cmd,
+ NULL, /* cmdstr is dynamically set in logging_vty_add_cmds(). */
+ NULL) /* same thing for helpstr. */
+{
+ vty_out(vty, "%% Ignoring deprecated logging level 'everything' keyword%s", VTY_NEWLINE);
+ return CMD_SUCCESS;
+}
+
DEFUN(logging_set_category_mask,
logging_set_category_mask_cmd,
"logging set-log-mask MASK",
@@ -858,8 +862,9 @@ static int config_write_log_single(struct vty *vty, struct log_target *tgt)
VTY_NEWLINE);
/* stupid old osmo logging API uses uppercase strings... */
- vty_out(vty, " logging level all %s%s", osmo_str_tolower(log_level_str(tgt->loglevel)),
- VTY_NEWLINE);
+ if (tgt->loglevel)
+ vty_out(vty, " logging level all %s%s", osmo_str_tolower(log_level_str(tgt->loglevel)),
+ VTY_NEWLINE);
for (i = 0; i < osmo_log_info->num_cat; i++) {
const struct log_category *cat = &tgt->categories[i];
@@ -896,7 +901,7 @@ void logging_vty_add_deprecated_subsys(void *ctx, const char *name)
{
struct cmd_element *cmd = talloc_zero(ctx, struct cmd_element);
OSMO_ASSERT(cmd);
- cmd->string = talloc_asprintf(cmd, "logging level %s (everything|debug|info|notice|error|fatal)",
+ cmd->string = talloc_asprintf(cmd, "logging level %s (debug|info|notice|error|fatal)",
name);
printf("%s\n", cmd->string);
cmd->func = log_deprecated_func;
@@ -924,12 +929,16 @@ void logging_vty_add_cmds()
install_element_ve(&logging_set_category_mask_cmd);
install_element_ve(&logging_set_category_mask_old_cmd);
- /* logging level (all|<categories>) (everything|debug|...|fatal) */
+ /* logging level (all|<categories>) (debug|...|fatal) */
gen_logging_level_cmd_strs(&logging_level_cmd,
- "(everything|" LOG_LEVEL_ARGS ")",
- EVERYTHING_STR LOG_LEVEL_STRS);
+ "(" LOG_LEVEL_ARGS ")",
+ LOG_LEVEL_STRS);
+ /* logging level (all|<categories>) everything */
+ gen_logging_level_cmd_strs(&deprecated_logging_level_everything_cmd,
+ "everything", EVERYTHING_STR);
install_element_ve(&logging_level_cmd);
+ install_element_ve(&deprecated_logging_level_everything_cmd);
install_element_ve(&show_logging_vty_cmd);
install_element_ve(&show_alarms_cmd);
@@ -943,6 +952,7 @@ void logging_vty_add_cmds()
install_element(CFG_LOG_NODE, &logging_prnt_level_cmd);
install_element(CFG_LOG_NODE, &logging_prnt_file_cmd);
install_element(CFG_LOG_NODE, &logging_level_cmd);
+ install_element(CFG_LOG_NODE, &deprecated_logging_level_everything_cmd);
install_element(CONFIG_NODE, &cfg_log_stderr_cmd);
install_element(CONFIG_NODE, &cfg_no_log_stderr_cmd);