summaryrefslogtreecommitdiff
path: root/lib/zlog.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/zlog.h')
-rw-r--r--lib/zlog.h27
1 files changed, 19 insertions, 8 deletions
diff --git a/lib/zlog.h b/lib/zlog.h
index bdf59fa68e..4fdb47bb95 100644
--- a/lib/zlog.h
+++ b/lib/zlog.h
@@ -44,6 +44,7 @@ struct xref_logmsg {
const char *fmtstring;
uint32_t priority;
uint32_t ec;
+ const char *args;
};
struct xrefdata_logmsg {
@@ -84,18 +85,23 @@ static inline void zlog_ref(const struct xref_logmsg *xref,
va_end(ap);
}
-#define _zlog_ref(prio, msg, ...) do { \
+#define _zlog_ref(prio, msg, ...) \
+ do { \
static struct xrefdata _xrefdata = { \
+ .xref = NULL, \
+ .uid = {}, \
.hashstr = (msg), \
- .hashu32 = { (prio), 0 }, \
+ .hashu32 = {(prio), 0}, \
}; \
- static const struct xref_logmsg _xref __attribute__((used)) = {\
+ static const struct xref_logmsg _xref __attribute__( \
+ (used)) = { \
.xref = XREF_INIT(XREFT_LOGMSG, &_xrefdata, __func__), \
.fmtstring = (msg), \
.priority = (prio), \
+ .args = (#__VA_ARGS__), \
}; \
XREF_LINK(_xref.xref); \
- zlog_ref(&_xref, (msg), ## __VA_ARGS__); \
+ zlog_ref(&_xref, (msg), ##__VA_ARGS__); \
} while (0)
#define zlog_err(...) _zlog_ref(LOG_ERR, __VA_ARGS__)
@@ -104,19 +110,24 @@ static inline void zlog_ref(const struct xref_logmsg *xref,
#define zlog_notice(...) _zlog_ref(LOG_NOTICE, __VA_ARGS__)
#define zlog_debug(...) _zlog_ref(LOG_DEBUG, __VA_ARGS__)
-#define _zlog_ecref(ec_, prio, msg, ...) do { \
+#define _zlog_ecref(ec_, prio, msg, ...) \
+ do { \
static struct xrefdata _xrefdata = { \
+ .xref = NULL, \
+ .uid = {}, \
.hashstr = (msg), \
- .hashu32 = { (prio), (ec_) }, \
+ .hashu32 = {(prio), (ec_)}, \
}; \
- static const struct xref_logmsg _xref __attribute__((used)) = {\
+ static const struct xref_logmsg _xref __attribute__( \
+ (used)) = { \
.xref = XREF_INIT(XREFT_LOGMSG, &_xrefdata, __func__), \
.fmtstring = (msg), \
.priority = (prio), \
.ec = (ec_), \
+ .args = (#__VA_ARGS__), \
}; \
XREF_LINK(_xref.xref); \
- zlog_ref(&_xref, "[EC %u] " msg, ec_, ## __VA_ARGS__); \
+ zlog_ref(&_xref, "[EC %u] " msg, ec_, ##__VA_ARGS__); \
} while (0)
#define flog_err(ferr_id, format, ...) \