aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/msgb.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@netfilter.org>2009-12-17 23:10:46 +0100
committerHarald Welte <laforge@netfilter.org>2009-12-17 23:10:46 +0100
commitb1d4c8ed9d2b4ecb76355d71a152c22934c48504 (patch)
treeadc7234f321e78f2ca9046d9d3cfc5933b9c1a29 /openbsc/src/msgb.c
parent66706812514c4baca743ad3a07e4556d48b6cded (diff)
logging: introduce log levels at caller site
This introduces a new LOGP() macro together with LOGL_* definition to support multiple log levels (severities) throughout the codebase. Please note that the actual logging system does not use them yet, in this patch we simply introduce the new macros at the caller site.
Diffstat (limited to 'openbsc/src/msgb.c')
-rw-r--r--openbsc/src/msgb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/openbsc/src/msgb.c b/openbsc/src/msgb.c
index edeb975a9..48a5a7b03 100644
--- a/openbsc/src/msgb.c
+++ b/openbsc/src/msgb.c
@@ -26,6 +26,7 @@
#include <openbsc/msgb.h>
#include <openbsc/gsm_data.h>
#include <openbsc/talloc.h>
+#include <openbsc/debug.h>
static void *tall_msgb_ctx;
@@ -35,8 +36,10 @@ struct msgb *msgb_alloc(u_int16_t size, const char *name)
msg = _talloc_zero(tall_msgb_ctx, sizeof(*msg) + size, name);
- if (!msg)
+ if (!msg) {
+ LOGP(DRSL, LOGL_FATAL, "unable to allocate msgb\n");
return NULL;
+ }
msg->data_len = size;
msg->len = 0;