summaryrefslogtreecommitdiffstats
path: root/src/vty
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2013-06-06 07:33:54 +0200
committerHarald Welte <laforge@gnumonks.org>2014-08-25 10:09:42 +0200
commitfb84f325b8e672ba7ca1a961f4ef01f4d011e33d (patch)
tree10801c74802d2f5715bea063fb4b362264e395ad /src/vty
parent276ca4b1722df573f9af7735820712bcaf32b800 (diff)
logging: Add ability to save/print current log filters
This enables the persistent configuration of let's say 'log filter imsi 012345678' for a given log file in the config file.
Diffstat (limited to 'src/vty')
-rw-r--r--src/vty/logging_vty.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c
index 64e49d7e..47877fe9 100644
--- a/src/vty/logging_vty.c
+++ b/src/vty/logging_vty.c
@@ -252,7 +252,9 @@ static void vty_print_logtarget(struct vty *vty, const struct log_info *info,
tgt->filter_map & LOG_FILTER_ALL ? "Enabled" : "Disabled",
VTY_NEWLINE);
- /* FIXME: print application specific filters */
+ /* print application specific filters */
+ if (info->print_fn)
+ info->print_fn(vty, info, tgt);
}
#define SHOW_LOG_STR "Show current logging configuration\n"
@@ -617,7 +619,9 @@ static int config_write_log_single(struct vty *vty, struct log_target *tgt)
vty_out(vty, " logging filter all %u%s",
tgt->filter_map & LOG_FILTER_ALL ? 1 : 0, VTY_NEWLINE);
- /* FIXME: how to do this for filters outside of libosmocore? */
+ /* save filters outside of libosmocore, i.e. in app code */
+ if (osmo_log_info->save_fn)
+ osmo_log_info->save_fn(vty, osmo_log_info, tgt);
vty_out(vty, " logging color %u%s", tgt->use_color ? 1 : 0,
VTY_NEWLINE);