Include filename explicitly in logging APIs

Currently the logging APIs have a 'const char *category' parameter
which indicates where the log message comes from. This is typically
a combination of the __FILE__ string and other prefix. Split the
__FILE__ off into a dedicated parameter so it can passed to the
log outputs

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange
2012-09-27 14:28:44 +01:00
parent 96a1be95ef
commit 0225c566f4
7 changed files with 55 additions and 42 deletions

View File

@@ -349,15 +349,15 @@
# define PROBE_EXPAND(NAME, ARGS) NAME(ARGS)
# define PROBE(NAME, FMT, ...) \
VIR_DEBUG_INT("trace." __FILE__ , __func__, __LINE__, \
VIR_DEBUG_INT("trace", __FILE__, __LINE__, __func__, \
#NAME ": " FMT, __VA_ARGS__); \
if (LIBVIRT_ ## NAME ## _ENABLED()) { \
PROBE_EXPAND(LIBVIRT_ ## NAME, \
if (LIBVIRT_ ## NAME ## _ENABLED()) { \
PROBE_EXPAND(LIBVIRT_ ## NAME, \
VIR_ADD_CASTS(__VA_ARGS__)); \
}
# else
# define PROBE(NAME, FMT, ...) \
VIR_DEBUG_INT("trace." __FILE__, __func__, __LINE__, \
VIR_DEBUG_INT("trace", __FILE__, __LINE__, __func__, \
#NAME ": " FMT, __VA_ARGS__);
# endif