diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-04-11 01:43:41 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-05-23 07:27:39 +0000 |
commit | 8da223342682d1e2c8d794e932bec98a33b1f0cc (patch) | |
tree | acf46eb11efa45364601ae3791a5a61a21160ceb /include/osmocom/bsc | |
parent | 20388b781d0f996922157ba20559cba1f973c808 (diff) |
bsc_api.c: actually log with context
bsc_api.c notoriously lacks log context. Provide gsm_lchan_name() and/or
bsc_subscr_name() in roughly a million instances, using new LOGPLCHAN macro.
Add LOGPLCHAN() to gsm_data.h, to encourage use of it in other .c files.
Change-Id: If469defcc6fe8950dac5df61db3f39d297893318
Diffstat (limited to 'include/osmocom/bsc')
-rw-r--r-- | include/osmocom/bsc/gsm_data.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 6f854d8a2..da5e87f8f 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -366,6 +366,14 @@ struct gsm_encr { uint8_t key[MAX_A5_KEY_LEN]; }; +#define LOGPLCHAN(lchan, ss, level, fmt, args...) \ + LOGP(ss, level, "%s (ss=%d,%s) (%s) " fmt, \ + lchan ? gsm_ts_and_pchan_name(lchan->ts) : "-", \ + lchan ? lchan->nr : 0, \ + lchan ? gsm_lchant_name(lchan->type) : "-", \ + bsc_subscr_name(lchan && lchan->conn ? lchan->conn->bsub : NULL), \ + ## args) + struct gsm_lchan { /* The TS that we're part of */ struct gsm_bts_trx_ts *ts; |