From a67704753a6328f725d38d61af8bfbe29012fcbc Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Mon, 5 Jan 2015 14:15:16 +0100 Subject: Revert "debug.c: use new libosmocore features to print and save log filter" This reverts commit c598e6e0a6d00827c2c974010d582815d66d0f14. It introduced a dependency from libcommon to libosmovty, which we don't want --- openbsc/src/libcommon/debug.c | 46 ------------------------------------------- 1 file changed, 46 deletions(-) (limited to 'openbsc/src/libcommon/debug.c') diff --git a/openbsc/src/libcommon/debug.c b/openbsc/src/libcommon/debug.c index cfaaa1756..ca7ff5da6 100644 --- a/openbsc/src/libcommon/debug.c +++ b/openbsc/src/libcommon/debug.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -194,53 +193,8 @@ static int filter_fn(const struct log_context *ctx, return 0; } -static void filter_print(struct vty *vty, - const struct log_info *info, - const struct log_target *tar) -{ - if ((tar->filter_map & (1 << FLT_IMSI)) != 0) - vty_out(vty, " Log Filter 'IMSI': %s%s", - tar->filter_data[FLT_IMSI], VTY_NEWLINE); - else - vty_out(vty, " Log Filter 'IMSI': Disabled%s", VTY_NEWLINE); - - if ((tar->filter_map & (1 << FLT_NSVC)) != 0) - vty_out(vty, " Log Filter 'NSVC': %u%s", - tar->filter_data[FLT_NSVC], VTY_NEWLINE); - else - vty_out(vty, " Log Filter 'NSVC': Disabled%s", VTY_NEWLINE); - - /* Filter on the NS Virtual Connection */ - if ((tar->filter_map & (1 << FLT_BVC)) != 0) - vty_out(vty, " Log Filter 'BVC': %u%s", - tar->filter_data[FLT_BVC], VTY_NEWLINE); - else - vty_out(vty, " Log Filter 'BVC': Disabled%s", VTY_NEWLINE); -} - -static void filter_save(struct vty *vty, - const struct log_info *info, - const struct log_target *tar) -{ - if ((tar->filter_map & (1 << FLT_IMSI)) != 0) - vty_out(vty, " logging filter imsi %s%s", - tar->filter_data[FLT_IMSI], VTY_NEWLINE); - - if ((tar->filter_map & (1 << FLT_NSVC)) != 0) - vty_out(vty, " logging filter nsvc %u%s", - tar->filter_data[FLT_NSVC], VTY_NEWLINE); - - if ((tar->filter_map & (1 << FLT_BVC)) != 0) - vty_out(vty, " logging filter bvc %u%s", - tar->filter_data[FLT_BVC], VTY_NEWLINE); -} - - - const struct log_info log_info = { .filter_fn = filter_fn, - .save_fn = filter_save, - .print_fn = filter_print, .cat = default_categories, .num_cat = ARRAY_SIZE(default_categories), }; -- cgit v1.2.3