pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-cbc/+/28825 )
Change subject: Introduce logging category smscb
......................................................................
Introduce logging category smscb
The smscb_message_fsm is totally independent of CBSP.
Change-Id: I6e686747ddde9540ff3f765ef461bfca812615ba
---
M doc/examples/osmo-cbc/osmo-cbc.cfg
M include/osmocom/cbc/debug.h
M src/cbc_main.c
M src/smscb_message_fsm.c
4 files changed, 13 insertions(+), 4 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, approved
laforge: Looks good to me, approved
diff --git a/doc/examples/osmo-cbc/osmo-cbc.cfg b/doc/examples/osmo-cbc/osmo-cbc.cfg
index 7f5ebdc..9874a39 100644
--- a/doc/examples/osmo-cbc/osmo-cbc.cfg
+++ b/doc/examples/osmo-cbc/osmo-cbc.cfg
@@ -1,5 +1,6 @@
log stderr
logging level main notice
+ logging level smscb notice
logging level cbsp notice
logging level sbcap notice
logging level asn1c notice
diff --git a/include/osmocom/cbc/debug.h b/include/osmocom/cbc/debug.h
index c0b3864..e07cfdd 100644
--- a/include/osmocom/cbc/debug.h
+++ b/include/osmocom/cbc/debug.h
@@ -2,6 +2,7 @@
enum {
DMAIN,
+ DSMSCB,
DCBSP,
DSBcAP,
DASN1C,
diff --git a/src/cbc_main.c b/src/cbc_main.c
index 5096dc8..7e13e52 100644
--- a/src/cbc_main.c
+++ b/src/cbc_main.c
@@ -62,6 +62,13 @@
.enabled = 1,
.loglevel = LOGL_NOTICE,
},
+ [DSMSCB] = {
+ .name = "DSMSCB",
+ .description = "SMS Cell Broadcast handling",
+ .color = "\033[1;35m",
+ .enabled = 1,
+ .loglevel = LOGL_NOTICE,
+ },
[DCBSP] = {
.name = "DCBSP",
.description = "Cell Broadcast Service Protocol (CBC-BSC)",
diff --git a/src/smscb_message_fsm.c b/src/smscb_message_fsm.c
index ba17910..40d4535 100644
--- a/src/smscb_message_fsm.c
+++ b/src/smscb_message_fsm.c
@@ -335,7 +335,7 @@
.allstate_event_mask = S(SMSCB_E_CHILD_DIED),
.allstate_action = smscb_fsm_allstate,
.timer_cb = smscb_fsm_timer_cb,
- .log_subsys = DCBSP,
+ .log_subsys = DSMSCB,
.event_names = smscb_fsm_event_names,
.cleanup= smscb_fsm_cleanup,
};
@@ -349,7 +349,7 @@
char idbuf[32];
if (cbc_message_by_id(orig_msg->msg.message_id)) {
- LOGP(DCBSP, LOGL_ERROR, "Cannot create message_id %u (already exists)\n",
+ LOGP(DSMSCB, LOGL_ERROR, "Cannot create message_id %u (already exists)\n",
orig_msg->msg.message_id);
return NULL;
}
@@ -357,13 +357,13 @@
snprintf(idbuf, sizeof(idbuf), "%s-%u", orig_msg->cbe_name,
orig_msg->msg.message_id);
fi = osmo_fsm_inst_alloc(&smscb_fsm, ctx, NULL, LOGL_INFO, idbuf);
if (!fi) {
- LOGP(DCBSP, LOGL_ERROR, "Cannot allocate cbc_message fsm\n");
+ LOGP(DSMSCB, LOGL_ERROR, "Cannot allocate cbc_message fsm\n");
return NULL;
}
smscb = talloc(fi, struct cbc_message);
if (!smscb) {
- LOGP(DCBSP, LOGL_ERROR, "Cannot allocate cbc_message\n");
+ LOGP(DSMSCB, LOGL_ERROR, "Cannot allocate cbc_message\n");
osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL);
return NULL;
}
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
--
To view, visit
https://gerrit.osmocom.org/c/osmo-cbc/+/28825
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-cbc
Gerrit-Branch: master
Gerrit-Change-Id: I6e686747ddde9540ff3f765ef461bfca812615ba
Gerrit-Change-Number: 28825
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged