summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-10-09 17:56:04 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2017-10-10 02:39:09 +0200
commit40aa61ccf0e45df0d7e1d58521a118d4c5a953ee (patch)
treecb3b4d26780d6a21de97ecf0e0e905146dbc5a25 /src
parent0cac0a067e5824d0e0dc6b3109d7f33974c60df4 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/db_auc.c4
-rw-r--r--src/db_hlr.c2
2 files changed, 3 insertions, 3 deletions
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 @@ int db_get_auth_data(struct db_context *dbc, const char *imsi,
/* 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); \