[MERGED] libosmocore[master]: fix: DLGSUP logging category "unusable"

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Dec 12 11:01:11 UTC 2016


Harald Welte has submitted this change and it was merged.

Change subject: fix: DLGSUP logging category "unusable"
......................................................................


fix: DLGSUP logging category "unusable"

All DL* categories are typically negative, but DLGSUP isn't, and it's also not
in libosmocore's internal_cat array.
See: 3b6fb0880c3ab1e23a3d7d738d073b00c2a794c2

This means that a program using DLGSUP has to include DLGSUP in its own logging
cat array (typically not needed for DL* categories), which means for osmo-nitb
that DLGSUP (11) replaces DMGCP (also 11), and DMGCP becomes unusable.

Fix this: make DLGSUP -11 and include in internal_cat.

In gsup_test.c, no longer add DLGSUP to the logging categories array.

External follow-ups are otherwise needed only in osmo-hlr.git and some pending
patches for openbsc (Id3938267fa062e1a997d3704cd678874306f86ee).

Change-Id: Id974c7be158e4d60421a98110f5c807aefd31119
---
M include/osmocom/core/logging.h
M src/logging.c
M tests/gsup/gsup_test.c
3 files changed, 6 insertions(+), 6 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h
index ad775b9..cc3919b 100644
--- a/include/osmocom/core/logging.h
+++ b/include/osmocom/core/logging.h
@@ -92,7 +92,7 @@
 #define DLCTRL		-8	/*!< Control Interface */
 #define DLGTP		-9	/*!< GTP (GPRS Tunneling Protocol */
 #define DLSTATS		-10	/*!< Statistics */
-#define DLGSUP		11	/*!< Generic Subscriber Update Protocol */
+#define DLGSUP		-11	/*!< Generic Subscriber Update Protocol */
 #define OSMO_NUM_DLIB	11	/*!< Number of logging sub-systems in libraries */
 
 /*! Configuration of singgle log category / sub-system */
diff --git a/src/logging.c b/src/logging.c
index 1516a7d..30d0b8d 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -123,6 +123,11 @@
 		.description = "Statistics messages and logging",
 		.enabled = 1, .loglevel = LOGL_NOTICE,
 	},
+	[INT2IDX(DLGSUP)] = {
+		.name = "DLGSUP",
+		.description = "Generic Subscriber Update Protocol",
+		.enabled = 1, .loglevel = LOGL_NOTICE,
+	},
 };
 
 /*! \brief descriptive string for each log level */
diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c
index 2b0a293..7af16b7 100644
--- a/tests/gsup/gsup_test.c
+++ b/tests/gsup/gsup_test.c
@@ -241,11 +241,6 @@
 }
 
 const struct log_info_cat default_categories[] = {
-	[DLGSUP] = {
-		.name = "DLGSUP",
-		.description = "Generic Subscriber Update Protocol",
-		.enabled = 0, .loglevel = LOGL_DEBUG,
-	},
 };
 
 static struct log_info info = {

-- 
To view, visit https://gerrit.osmocom.org/1402
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id974c7be158e4d60421a98110f5c807aefd31119
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list