diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2020-04-09 04:59:20 +0700 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2020-04-09 05:13:59 +0700 |
commit | b217b9b3e597e96c0541c4493f8f4ded28ed7804 (patch) | |
tree | f98aca5b39b6dfac3962669d778250764e2a03f7 | |
parent | 75ae23674c3c74bc83361559db0e218432562098 (diff) |
trxcon/logging: print category, level and extended timestamp
Since we're heavily using trxcon in ttcn3-bts-test, the logging
output should contain as much information as possible. Ideally
we should introduce the VTY interface (see OS#3666) and get
logging configuration options as a bonus. But let's just use
some beneficial hard-coded defaults for now:
- print category and level (huh, we use NOTICE everywhere?),
- do not print category-hex (who needs it anyway?),
- print extended timestamp, so we're in synce with other logs.
P.S. This configuration is based on my own debugging experience.
Change-Id: Ie3d259f3255d8af80e6780f850b808fa243f97b4
-rw-r--r-- | src/host/trxcon/trxcon.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/host/trxcon/trxcon.c b/src/host/trxcon/trxcon.c index ecee518c..dfce2b8e 100644 --- a/src/host/trxcon/trxcon.c +++ b/src/host/trxcon/trxcon.c @@ -1,7 +1,7 @@ /* * OsmocomBB <-> SDR connection bridge * - * (C) 2016-2019 by Vadim Yanitskiy <axilirator@gmail.com> + * (C) 2016-2020 by Vadim Yanitskiy <axilirator@gmail.com> * * All Rights Reserved * @@ -53,7 +53,7 @@ #include "sched_trx.h" #define COPYRIGHT \ - "Copyright (C) 2016-2019 by Vadim Yanitskiy <axilirator@gmail.com>\n" \ + "Copyright (C) 2016-2020 by Vadim Yanitskiy <axilirator@gmail.com>\n" \ "License GPLv2+: GNU GPL version 2 or later " \ "<http://gnu.org/licenses/gpl.html>\n" \ "This is free software: you are free to change and redistribute it.\n" \ @@ -283,6 +283,12 @@ int main(int argc, char **argv) /* Init logging system */ trx_log_init(tall_trxcon_ctx, app_data.debug_mask); + /* Configure pretty logging */ + log_set_print_extended_timestamp(osmo_stderr_target, 1); + log_set_print_category_hex(osmo_stderr_target, 0); + log_set_print_category(osmo_stderr_target, 1); + log_set_print_level(osmo_stderr_target, 1); + /* Optional GSMTAP */ if (app_data.gsmtap_ip != NULL) { gsmtap = gsmtap_source_init(app_data.gsmtap_ip, GSMTAP_UDP_PORT, 1); |