From 7997bf4bed15fa8c6807820b1a9b379a2ae0c61e Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Tue, 13 Feb 2018 17:16:44 +0100 Subject: libcommon: eliminate debug.c Provide concise log categories for each main scope. Move the complete log categories 1:1 to osmo_bsc_main.c. In bsc_nat.c, omit obviously unused log categories. In tests, omit almost all log categories, except for those explicitly tested as the expected output. Note: should any logging occur for a log category that is omitted by accident, such will end up being logged as DLGLOBAL, so it will show up and we can fix it, and it will not get lost silently. Change-Id: Ib524e49ec211662e0dfde8161495a72aa8ad76cf --- src/osmo-bsc_nat/bsc_nat.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/osmo-bsc_nat') diff --git a/src/osmo-bsc_nat/bsc_nat.c b/src/osmo-bsc_nat/bsc_nat.c index 87db68478..c1c791392 100644 --- a/src/osmo-bsc_nat/bsc_nat.c +++ b/src/osmo-bsc_nat/bsc_nat.c @@ -1627,6 +1627,39 @@ static struct vty_app_info vty_info = { .is_config_node = bsc_vty_is_config_node, }; +static const struct log_info_cat log_categories[] = { + [DNM] = { + .name = "DNM", + .description = "A-bis Network Management / O&M (NM/OML)", + .color = "\033[1;36m", + .enabled = 1, .loglevel = LOGL_INFO, + }, + [DNAT] = { + .name = "DNAT", + .description = "GSM 08.08 NAT/Multiplexer", + .enabled = 1, .loglevel = LOGL_NOTICE, + }, + [DMSC] = { + .name = "DMSC", + .description = "Mobile Switching Center", + .enabled = 1, .loglevel = LOGL_NOTICE, + }, + [DCTRL] = { + .name = "DCTRL", + .description = "Control interface", + .enabled = 1, .loglevel = LOGL_NOTICE, + }, + [DFILTER] = { + .name = "DFILTER", + .description = "BSC/NAT IMSI based filtering", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, +}; + +static const struct log_info log_info = { + .cat = log_categories, + .num_cat = ARRAY_SIZE(log_categories), +}; int main(int argc, char **argv) { -- cgit v1.2.3