aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gprs_bssgp_vty.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-02-18 21:10:05 +0100
committerHarald Welte <laforge@gnumonks.org>2011-02-18 21:10:05 +0100
commit8dcebd3e7f787d1badb78d3b8ffb98543adca5c9 (patch)
tree7474d58279687dd370e65e2dafcd1e584d6fcf45 /openbsc/src/gprs/gprs_bssgp_vty.c
parent64c07d213c7bf09813a16a7aad8bacacfdc3011a (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/gprs/gprs_bssgp_vty.c')
-rw-r--r--openbsc/src/gprs/gprs_bssgp_vty.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/openbsc/src/gprs/gprs_bssgp_vty.c b/openbsc/src/gprs/gprs_bssgp_vty.c
index 6208ae3c1..9ebd09004 100644
--- a/openbsc/src/gprs/gprs_bssgp_vty.c
+++ b/openbsc/src/gprs/gprs_bssgp_vty.c
@@ -138,16 +138,13 @@ DEFUN(logging_fltr_bvc,
"BVCI of the BVC to be filtered\n"
"BSSGP Virtual Connection Identifier (BVCI)\n")
{
- struct telnet_connection *conn;
+ struct log_target *tgt = osmo_log_vty2tgt(vty);
struct bssgp_bvc_ctx *bvc;
uint16_t nsei = atoi(argv[0]);
uint16_t bvci = atoi(argv[1]);
- conn = (struct telnet_connection *) vty->priv;
- if (!conn->dbg) {
- vty_out(vty, "Logging was not enabled.%s", VTY_NEWLINE);
+ if (!tgt)
return CMD_WARNING;
- }
bvc = btsctx_by_bvci_nsei(bvci, nsei);
if (!bvc) {
@@ -155,7 +152,7 @@ DEFUN(logging_fltr_bvc,
return CMD_WARNING;
}
- log_set_bvc_filter(conn->dbg, bvc);
+ log_set_bvc_filter(tgt, bvc);
return CMD_SUCCESS;
}
@@ -166,6 +163,8 @@ int gprs_bssgp_vty_init(void)
install_element_ve(&show_bvc_cmd);
install_element_ve(&logging_fltr_bvc_cmd);
+ install_element(CFG_LOG_NODE, &logging_fltr_bvc_cmd);
+
install_element(CONFIG_NODE, &cfg_bssgp_cmd);
install_node(&bssgp_node, config_write_bssgp);
install_default(BSSGP_NODE);