aboutsummaryrefslogtreecommitdiffstats
path: root/include
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 /include
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 'include')
-rw-r--r--include/osmocom/bsc/debug.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/osmocom/bsc/debug.h b/include/osmocom/bsc/debug.h
index e78ba59a8..326012185 100644
--- a/include/osmocom/bsc/debug.h
+++ b/include/osmocom/bsc/debug.h
@@ -29,3 +29,9 @@ enum {
DAS,
Debug_LastEntry,
};
+
+#define LOG_BTS(bts, subsys, level, fmt, args...) \
+ LOGP(subsys, level, "(bts=%d) " fmt, (bts)->nr, ## args)
+
+#define LOG_TRX(trx, subsys, level, fmt, args...) \
+ LOGP(subsys, level, "(bts=%d,trx=%d) " fmt, (trx)->bts->nr, (trx)->nr, ## args)