summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2013-03-14 20:50:20 +0100
committerHarald Welte <laforge@gnumonks.org>2013-03-14 20:50:20 +0100
commitd9f04cf80fa35762a49c87672cbd241d00e438da (patch)
tree56c1e09c41b7b7ff353527407e7537f39466db0a
parent93b5b8fe5e7c7be7474bee08879e723cfa45f917 (diff)
Convert DEBUG to ERROR/INFO/NOTICE where applicable
-rw-r--r--src/gsmd/atcmd.c26
-rw-r--r--src/gsmd/unsolicited.c8
2 files changed, 17 insertions, 17 deletions
diff --git a/src/gsmd/atcmd.c b/src/gsmd/atcmd.c
index d8a01b6..faa91f3 100644
--- a/src/gsmd/atcmd.c
+++ b/src/gsmd/atcmd.c
@@ -74,7 +74,7 @@ static inline int llparse_append(struct llparser *llp, char byte)
*(llp->cur++) = byte;
return 0;
} else {
- DEBUGP("llp->cur too big!!!\n");
+ gsmd_log(GSMD_ERROR, "llp->cur too big!!!\n");
return -EFBIG;
}
}
@@ -101,7 +101,7 @@ static int llparse_byte(struct llparser *llp, char byte)
llp->state = LLPARSE_STATE_PROMPT;
else {
#ifdef STRICT
- DEBUGP("IDLE: no \\r or > following \\r\n");
+ gsmd_log(GSMD_ERROR, "IDLE: no \\r or > following \\r\n");
llp->state = LLPARSE_STATE_ERROR;
#else
llp->state = LLPARSE_STATE_RESULT;
@@ -117,7 +117,7 @@ static int llparse_byte(struct llparser *llp, char byte)
if (byte == '\n')
llp->state = LLPARSE_STATE_IDLE_LF;
else if (byte != '\r') {
- DEBUGP("IDLE_CR: no \\r following \\n\n");
+ gsmd_log(GSMD_ERROR, "IDLE_CR: no \\r following \\n\n");
llp->state = LLPARSE_STATE_ERROR;
}
break;
@@ -159,7 +159,7 @@ static int llparse_byte(struct llparser *llp, char byte)
}
break;
case LLPARSE_STATE_ERROR:
- DEBUGP("already in state ERROR\n");
+ gsmd_log(GSMD_ERROR, "already in state ERROR\n");
break;
}
@@ -288,7 +288,7 @@ static int ml_parse(const char *buf, int len, void *ctx)
struct gsmd_atcmd, list);
if (cmd && !strcmp(buf, cmd->buf)) {
- DEBUGP("ignoring echo\n");
+ gsmd_log(GSMD_INFO, "ignoring echo\n");
return 0;
}
@@ -318,7 +318,7 @@ static int ml_parse(const char *buf, int len, void *ctx)
/* Part of Case 'C' */
unsigned long err_nr;
err_nr = strtoul(colon+1, NULL, 10);
- DEBUGP("error number %lu\n", err_nr);
+ gsmd_log(GSMD_ERROR, "CME error number %lu\n", err_nr);
if (cmd)
cmd->ret = err_nr;
cme_error = 1;
@@ -328,7 +328,7 @@ static int ml_parse(const char *buf, int len, void *ctx)
/* Part of Case 'C' */
unsigned long err_nr;
err_nr = strtoul(colon+1, NULL, 10);
- DEBUGP("error number %lu\n", err_nr);
+ gsmd_log(GSMD_ERROR, "CMS error number %lu\n", err_nr);
if (cmd)
cmd->ret = err_nr;
cms_error = 1;
@@ -399,7 +399,7 @@ static int ml_parse(const char *buf, int len, void *ctx)
if (!strcmp(buf, "ERROR") ||
((g->flags & GSMD_FLAG_V0) && buf[0] == '4')) {
/* Part of Case 'C' */
- DEBUGP("unspecified error\n");
+ gsmd_log(GSMD_ERROR, "unspecified error\n");
if (cmd)
cmd->ret = 4;
goto final_cb;
@@ -559,16 +559,16 @@ static void discard_timeout(struct gsmd_timer *tmr, void *data)
{
struct gsmd *g=data;
struct gsmd_atcmd *cmd=NULL;
- DEBUGP("discard time out!!\n");
+ gsmd_log(GSMD_NOTICE, "discard time out!!\n");
if (!llist_empty(&g->busy_atcmds)) {
cmd = llist_entry(g->busy_atcmds.next,struct gsmd_atcmd, list);
}
if (!cmd) {
- DEBUGP("ERROR!! busy_atcmds is NULL\n");
+ gsmd_log(GSMD_ERROR, "ERROR!! busy_atcmds is NULL\n");
return;
}
if (cmd->timeout != tmr) {
- DEBUGP("ERROR!! cmd->timeout != tmr\n");
+ gsmd_log(GSMD_ERROR, "ERROR!! cmd->timeout != tmr\n");
return;
}
@@ -643,7 +643,7 @@ static int remove_timer(struct gsmd_atcmd * cmd)
gsmd_timer_free(cmd->timeout);
cmd->timeout = NULL;
} else {
- DEBUGP("ERROR!! The %s response comes too late!!\n", cmd->buf);
+ gsmd_log(GSMD_ERROR, "ERROR!! The %s response comes too late!!\n", cmd->buf);
}
return 0;
@@ -677,7 +677,7 @@ int cancel_atcmd(struct gsmd *g, struct gsmd_atcmd *cmd)
return atcmd_submit(g, cmd);
}
cur = llist_entry(g->busy_atcmds.next, struct gsmd_atcmd, list);
- DEBUGP("cancelling command `%s' with an `%s'\n", cur->buf, cmd->buf);
+ gsmd_log(GSMD_NOTICE, "cancelling command `%s' with an `%s'\n", cur->buf, cmd->buf);
if (g->mlbuf_len) {
DEBUGP("Discarding mlbuf: %.*s\n", g->mlbuf_len, g->mlbuf);
diff --git a/src/gsmd/unsolicited.c b/src/gsmd/unsolicited.c
index 97d4b55..17892be 100644
--- a/src/gsmd/unsolicited.c
+++ b/src/gsmd/unsolicited.c
@@ -76,7 +76,7 @@ int usock_evt_send(struct gsmd *gsmd, struct gsmd_ucmd *ucmd, u_int32_t evt)
else {
struct gsmd_ucmd *cpy = ucmd_copy(ucmd);
if (!cpy) {
- fprintf(stderr,
+ gsmd_log(GSMD_ERROR,
"can't allocate memory for "
"copy of ucmd\n");
return num_sent;
@@ -302,7 +302,7 @@ static int ccwa_parse(const char *buf, int len, const char *param,
aux->u.ccwa.cli = er->tokens[4].u.numeric;
}
else {
- DEBUGP("Invalid Input : Parse error\n");
+ gsmd_log(GSMD_ERROR, "Invalid Input : Parse error\n");
return -EINVAL;
}
@@ -370,7 +370,7 @@ static int clip_parse(const char *buf, int len, const char *param,
strcpy(aux->u.clip.addr.number, er->tokens[0].u.string);
aux->u.clip.addr.type = er->tokens[1].u.numeric;
} else {
- DEBUGP("Invalid Input : Parse error\n");
+ gsmd_log(GSMD_ERROR, "Invalid Input : Parse error\n");
return -EINVAL;
}
@@ -406,7 +406,7 @@ static int colp_parse(const char *buf, int len, const char *param,
strcpy(aux->u.colp.addr.number, er->tokens[0].u.string);
aux->u.colp.addr.type = er->tokens[1].u.numeric;
} else {
- DEBUGP("Invalid Input : Parse error\n");
+ gsmd_log(GSMD_ERROR, "Invalid Input : Parse error\n");
return -EINVAL;
}
personal git repositories of Harald Welte. Your mileage may vary