[PATCH] osmo-hlr[master]: cosmetic: log IMSI='<imsi>', log "no such subscriber"

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/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Tue Oct 10 01:31:58 UTC 2017


Review at  https://gerrit.osmocom.org/4174

cosmetic: log IMSI='<imsi>', log "no such subscriber"

In LOGHLR and LOGAUC, log IMSI='<imsi>' instead of just <imsi>:
In the log, it is not always obvious to the reader that the printed number
refers to an IMSI (vs. an MSISDN or in the future an IMEI).

In db_get_auth_data(), log "No such subscriber" instead of just "Unknown", to
clarify what exactly is meant.

Change-Id: I2ec8ab5e67d4e95083f6e39232fc91ebaa080cb8
---
M src/db_auc.c
M src/db_hlr.c
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/74/4174/1

diff --git a/src/db_auc.c b/src/db_auc.c
index 07039d4..7aad06d 100644
--- a/src/db_auc.c
+++ b/src/db_auc.c
@@ -30,7 +30,7 @@
 #include "auc.h"
 #include "rand.h"
 
-#define LOGAUC(imsi, level, fmt, args ...)	LOGP(DAUC, level, "%s: " fmt, imsi, ## args)
+#define LOGAUC(imsi, level, fmt, args ...)	LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args)
 
 /* update the SQN for a given subscriber ID */
 int db_update_sqn(struct db_context *dbc, uint64_t id,
@@ -98,7 +98,7 @@
 	/* execute the statement */
 	rc = sqlite3_step(stmt);
 	if (rc == SQLITE_DONE) {
-		LOGAUC(imsi, LOGL_INFO, "Unknown\n");
+		LOGAUC(imsi, LOGL_INFO, "No such subscriber\n");
 		ret = 0;
 		goto out;
 	} else if (rc != SQLITE_ROW) {
diff --git a/src/db_hlr.c b/src/db_hlr.c
index 3bf3912..4bccca4 100644
--- a/src/db_hlr.c
+++ b/src/db_hlr.c
@@ -28,7 +28,7 @@
 #include "logging.h"
 #include "db.h"
 
-#define LOGHLR(imsi, level, fmt, args ...)	LOGP(DAUC, level, "%s: " fmt, imsi, ## args)
+#define LOGHLR(imsi, level, fmt, args ...)	LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args)
 
 #define SL3_TXT(x, stmt, idx)					do {	\
 		const char *_txt = (const char *) sqlite3_column_text(stmt, idx);	\

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ec8ab5e67d4e95083f6e39232fc91ebaa080cb8
Gerrit-PatchSet: 1
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list