aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/lchan_select.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-06-13 16:37:24 +0200
committerlaforge <laforge@gnumonks.org>2019-07-16 04:00:19 +0000
commitafe987f848f11ceb48c7be1f7842df44363efcd0 (patch)
treee494389aaf9e417d89ed6de8c11d93e04bbdd7e8 /src/osmo-bsc/lchan_select.c
parent4d4db8c7b553d784a21c585884fcfc43f5cc0cc3 (diff)
logging: introduce LOG_BTS and LOG_TRX and use it everywhere
It's quite ugly to have manual "bts=%d" printf-statements all over the BSC code. Let's change this to use shared logging helper functions all over the place, whenever we need to log something related to one BTS or one TRX. This can also help us as the first step to later add alternative logging of BTS identities, e.g. by printing the Cell Global Identifier or LAC+CI, or even a human-readable/vty-defined 'name' of the BTS, rather than its numeric bts number. With this change in place, we can introduce such changes at a single location in the code. Change-Id: I4a7814d164384eecfb6913c31802cf2faead6e6c
Diffstat (limited to 'src/osmo-bsc/lchan_select.c')
-rw-r--r--src/osmo-bsc/lchan_select.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/osmo-bsc/lchan_select.c b/src/osmo-bsc/lchan_select.c
index 0a9752e44..6df3b4a6b 100644
--- a/src/osmo-bsc/lchan_select.c
+++ b/src/osmo-bsc/lchan_select.c
@@ -169,7 +169,7 @@ struct gsm_lchan *lchan_select_by_type(struct gsm_bts *bts, enum gsm_chan_t type
struct gsm_lchan *lchan = NULL;
enum gsm_phys_chan_config first, first_cbch, second, second_cbch;
- LOGP(DRLL, LOGL_DEBUG, "(bts=%d) lchan_select_by_type(%s)\n", bts->nr, gsm_lchant_name(type));
+ LOG_BTS(bts, DRLL, LOGL_DEBUG, "lchan_select_by_type(%s)\n", gsm_lchant_name(type));
switch (type) {
case GSM_LCHAN_SDCCH:
@@ -227,15 +227,15 @@ struct gsm_lchan *lchan_select_by_type(struct gsm_bts *bts, enum gsm_chan_t type
}
break;
default:
- LOGP(DRLL, LOGL_ERROR, "Unknown gsm_chan_t %u\n", type);
+ LOG_BTS(bts, DRLL, LOGL_ERROR, "Unknown gsm_chan_t %u\n", type);
}
if (lchan) {
lchan->type = type;
LOG_LCHAN(lchan, LOGL_INFO, "Selected\n");
} else
- LOGP(DRLL, LOGL_ERROR, "(bts=%d) Failed to select %s channel\n",
- bts->nr, gsm_lchant_name(type));
+ LOG_BTS(bts, DRLL, LOGL_ERROR, "Failed to select %s channel\n",
+ gsm_lchant_name(type));
return lchan;
}