diff options
author | Harald Welte <laforge@netfilter.org> | 2009-12-17 23:10:46 +0100 |
---|---|---|
committer | Harald Welte <laforge@netfilter.org> | 2009-12-17 23:10:46 +0100 |
commit | b1d4c8ed9d2b4ecb76355d71a152c22934c48504 (patch) | |
tree | adc7234f321e78f2ca9046d9d3cfc5933b9c1a29 /openbsc/include | |
parent | 66706812514c4baca743ad3a07e4556d48b6cded (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/include')
-rw-r--r-- | openbsc/include/openbsc/debug.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/debug.h b/openbsc/include/openbsc/debug.h index c1098a53c..fc387cec3 100644 --- a/openbsc/include/openbsc/debug.h +++ b/openbsc/include/openbsc/debug.h @@ -44,4 +44,15 @@ void debug_use_color(int use_color); void debug_timestamp(int enable); extern unsigned int debug_mask; +/* new logging interface */ +#define LOGP(ss, level, fmt, args...) debugp(ss, __FILE__, __LINE__, 0, fmt, ##args) +#define LOGPC(ss, level, fmt, args...) debugp(ss, __FILE__, __LINE__, 1, fmt, ##args) + +/* different levels */ +#define LOGL_DEBUG 1 /* debugging information */ +#define LOGL_INFO 3 +#define LOGL_NOTICE 5 /* abnormal/unexpected condition */ +#define LOGL_ERROR 7 /* error condition, requires user action */ +#define LOGL_FATAL 8 /* fatal, program aborted */ + #endif /* _DEBUG_H */ |