From b09fb35b097399f970a933c340f3bfd8c449fc1e Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Sun, 24 Jun 2012 18:15:14 +0200 Subject: [PATCH] llog: add direct log helpers Sometimes, the parent object might not be available so we need to pass in the log-object directly. Use "d" as prefix for those functions and add variants for the most oftenly used functions. If you need more direct variants, add them when you introduce the first user. Signed-off-by: David Herrmann --- src/llog.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/llog.h b/src/llog.h index 600fe69..6213cf0 100644 --- a/src/llog.h +++ b/src/llog.h @@ -97,6 +97,8 @@ static const char *LLOG_SUBSYSTEM __attribute__((__unused__)); #define llog_printf(obj, sev, format, ...) \ llog_format((obj)->llog, LLOG_DEFAULT, (sev), (format), ##__VA_ARGS__) +#define llog_dprintf(obj, sev, format, ...) \ + llog_format((obj), LLOG_DEFAULT, (sev), (format), ##__VA_ARGS__) /* * Helpers @@ -107,9 +109,12 @@ static const char *LLOG_SUBSYSTEM __attribute__((__unused__)); */ #ifdef LLOG_ENABLE_DEBUG + #define llog_ddebug(obj, format, ...) \ + llog_dprintf((obj), LLOG_DEBUG, (format), ##__VA_ARGS__) #define llog_debug(obj, format, ...) \ - llog_printf((obj), LLOG_DEBUG, (format), ##__VA_ARGS__) + llog_ddebug((obj)->llog, (format), ##__VA_ARGS__) #else + #define llog_ddebug(obj, format, ...) #define llog_debug(obj, format, ...) #endif -- 2.7.4