summaryrefslogtreecommitdiff
path: root/lib/zlog.h
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2021-02-14 00:53:27 +0100
committerDavid Lamparter <equinox@diac24.net>2021-02-23 16:56:58 +0100
commit2621bb8b8dee4222da22bbc5c8036de70af096fb (patch)
tree21ced8d6c99135a923380e4be8e40ee0ef91d777 /lib/zlog.h
parenta1e6ab1e9334a4f266cd7133f1deb2193811f386 (diff)
lib/xref: record log message format args
Apparently you can do `#__VA_ARGS__` and it actually does something sensible, so here we go recording the format parameters for log messages into the xref. This allows some more checking in xrelfo.py, e.g. hints to use `%pFX` and co. Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'lib/zlog.h')
-rw-r--r--lib/zlog.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/zlog.h b/lib/zlog.h
index 3e86aa1345..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 {
@@ -97,6 +98,7 @@ static inline void zlog_ref(const struct xref_logmsg *xref,
.xref = XREF_INIT(XREFT_LOGMSG, &_xrefdata, __func__), \
.fmtstring = (msg), \
.priority = (prio), \
+ .args = (#__VA_ARGS__), \
}; \
XREF_LINK(_xref.xref); \
zlog_ref(&_xref, (msg), ##__VA_ARGS__); \
@@ -122,6 +124,7 @@ static inline void zlog_ref(const struct xref_logmsg *xref,
.fmtstring = (msg), \
.priority = (prio), \
.ec = (ec_), \
+ .args = (#__VA_ARGS__), \
}; \
XREF_LINK(_xref.xref); \
zlog_ref(&_xref, "[EC %u] " msg, ec_, ##__VA_ARGS__); \