diff options
author | Harald Welte <laforge@gnumonks.org> | 2011-02-18 21:10:05 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-02-18 21:10:05 +0100 |
commit | 8dcebd3e7f787d1badb78d3b8ffb98543adca5c9 (patch) | |
tree | 7474d58279687dd370e65e2dafcd1e584d6fcf45 /openbsc/src/bsc_vty.c | |
parent | 64c07d213c7bf09813a16a7aad8bacacfdc3011a (diff) |
LOGGING: make sure to make the 'logging filter' compatible with vty log cfg
Recent libosmocore introdues a way how log targets can be configured from
the VTY.
This commit makes the 'log filter (imsi|nsvc|bvc)' compatible with it.
Diffstat (limited to 'openbsc/src/bsc_vty.c')
-rw-r--r-- | openbsc/src/bsc_vty.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/openbsc/src/bsc_vty.c b/openbsc/src/bsc_vty.c index 55a667cdf..6e07a6b7f 100644 --- a/openbsc/src/bsc_vty.c +++ b/openbsc/src/bsc_vty.c @@ -2504,18 +2504,16 @@ DEFUN(logging_fltr_imsi, LOGGING_STR FILTER_STR "Filter log messages by IMSI\n" "IMSI to be used as filter\n") { - struct telnet_connection *conn; + struct log_target *tgt = osmo_log_vty2tgt(vty); - conn = (struct telnet_connection *) vty->priv; - if (!conn->dbg) { - vty_out(vty, "Logging was not enabled.%s", VTY_NEWLINE); + if (!tgt) return CMD_WARNING; - } - log_set_imsi_filter(conn->dbg, argv[0]); + log_set_imsi_filter(tgt, argv[0]); return CMD_SUCCESS; } + DEFUN(drop_bts, drop_bts_cmd, "drop bts connection <0-65535> (oml|rsl)", @@ -2635,6 +2633,7 @@ int bsc_vty_init(void) install_element_ve(&show_paging_cmd); logging_vty_add_cmds(); + install_element(CFG_LOG_NODE, &logging_fltr_imsi_cmd); install_element(CONFIG_NODE, &cfg_net_cmd); install_node(&net_node, config_write_net); |