diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-04-14 16:56:52 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-04-14 17:11:21 +0200 |
commit | bc4257867b56f31719b2cbf75f4c9a5d09265f45 (patch) | |
tree | 2d25d168cc591919b6d5f86f1227ae14ecb6f3c7 /stp/stp_main.c | |
parent | acb914d54b00f1102f4b849ff0babc4b644a811f (diff) |
osmo-stp: Remove hack to always enable debug logging
... and rather use the config file based logging configuration, like
other osmocom programs, too.
Change-Id: I7e0fb869bd778d8c276dc8afd16ecd7f1965b74a
Diffstat (limited to 'stp/stp_main.c')
-rw-r--r-- | stp/stp_main.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/stp/stp_main.c b/stp/stp_main.c index 6fbc634..5412223 100644 --- a/stp/stp_main.c +++ b/stp/stp_main.c @@ -31,6 +31,7 @@ #include <osmocom/vty/vty.h> #include <osmocom/vty/ports.h> #include <osmocom/vty/telnet_interface.h> +#include <osmocom/vty/logging.h> #include <osmocom/sigtran/osmo_ss7.h> #include <osmocom/sigtran/sccp_sap.h> @@ -38,6 +39,7 @@ #include <osmocom/sigtran/protocol/sua.h> #include <osmocom/sigtran/protocol/m3ua.h> +/* we only use logging sub-systems of the various libraries so far */ static const struct log_info_cat log_info_cat[] = { }; @@ -46,18 +48,6 @@ static const struct log_info log_info = { .num_cat = ARRAY_SIZE(log_info_cat), }; -/* Hack to enable debug logging for all relevant (used?) subsystems */ -static void init_logging(void) -{ - const int log_cats[] = { DLSS7, DLSUA, DLM3UA, DLSCCP, DLINP }; - unsigned int i; - - osmo_init_logging(&log_info); - - for (i = 0; i < ARRAY_SIZE(log_cats); i++) - log_set_category_filter(osmo_stderr_target, log_cats[i], 1, LOGL_DEBUG); -} - static const char stp_copyright[] = "Copyright (C) 2015-2017 by Harald Welte <laforge@gnumonks.org>\r\n" "Contributions by Holger Freyther, Neels Hofmeyr\r\n" @@ -82,10 +72,11 @@ int main(int argc, char **argv) fputs(stp_copyright, stdout); fputs("\n", stdout); - init_logging(); + osmo_init_logging(&log_info); osmo_ss7_init(); osmo_fsm_log_addr(false); vty_init(&vty_info); + logging_vty_add_cmds(&log_info); osmo_ss7_vty_init_sg(); rc = vty_read_config_file(config_file, NULL); |