diff options
Diffstat (limited to 'src/common/logging.c')
-rw-r--r-- | src/common/logging.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/common/logging.c b/src/common/logging.c index 3315a019..83407369 100644 --- a/src/common/logging.c +++ b/src/common/logging.c @@ -144,7 +144,21 @@ static struct log_info_cat bts_log_info_cat[] = { }, }; +static int osmo_bts_filter_fn(const struct log_context *ctx, struct log_target *tgt) +{ + uint8_t *sapi = ctx->ctx[LOG_CTX_L1_SAPI]; + uint16_t *sapi_mask = tgt->filter_data[LOG_FLT_L1_SAPI]; + + if ((tgt->filter_map & (1 << LOG_FLT_L1_SAPI)) != 0 + && sapi_mask && sapi + && (*sapi_mask & (1 << *sapi)) != 0) + return 1; + + return 0; +} + const struct log_info bts_log_info = { + .filter_fn = osmo_bts_filter_fn, .cat = bts_log_info_cat, .num_cat = ARRAY_SIZE(bts_log_info_cat), }; |