diff options
-rw-r--r-- | include/osmocom/vty/logging.h | 1 | ||||
-rw-r--r-- | src/vty/logging_vty.c | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/include/osmocom/vty/logging.h b/include/osmocom/vty/logging.h index 1baa3f83..90c8fa17 100644 --- a/include/osmocom/vty/logging.h +++ b/include/osmocom/vty/logging.h @@ -7,5 +7,6 @@ struct log_info; void logging_vty_add_cmds(); +void logging_vty_add_deprecated_subsys(void *ctx, const char *name); struct vty; struct log_target *osmo_log_vty2tgt(struct vty *vty); diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 09d207a7..8151fda0 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -836,6 +836,27 @@ static int config_write_log(struct vty *vty) return 1; } +static int log_deprecated_func(struct cmd_element *cmd, struct vty *vty, int argc, const char *argv[]) +{ + vty_out(vty, "%% Ignoring deprecated '%s'%s", cmd->string, VTY_NEWLINE); + return CMD_WARNING; +} + +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)", + name); + printf("%s\n", cmd->string); + cmd->func = log_deprecated_func; + cmd->doc = "Set the log level for a specified category\n" + "Deprecated Category\n"; + cmd->attr = CMD_ATTR_DEPRECATED; + + install_element(CFG_LOG_NODE, cmd); +} + /*! Register logging related commands to the VTY. Call this once from * your application if you want to support those commands. */ void logging_vty_add_cmds() |