From: Peter Krempa <[email protected]> The standard 'PROBE' macro uses the 'info' priority for the log entry corresponding to the probe point. While in some cases it makes sense to log above debug priority in others it does not. Add the possibility to pick a lower priority level.
Signed-off-by: Peter Krempa <[email protected]> --- src/util/virprobe.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/util/virprobe.h b/src/util/virprobe.h index 80a5f48ec8..d23b626d2f 100644 --- a/src/util/virprobe.h +++ b/src/util/virprobe.h @@ -90,6 +90,15 @@ VIR_ADD_CASTS(__VA_ARGS__)); \ } +# define PROBE_DEBUG(NAME, FMT, ...) \ + VIR_DEBUG_INT(&virLogSelf, \ + __FILE__, __LINE__, __func__, \ + #NAME ": " FMT, __VA_ARGS__); \ + if (LIBVIRT_ ## NAME ## _ENABLED()) { \ + PROBE_EXPAND(LIBVIRT_ ## NAME, \ + VIR_ADD_CASTS(__VA_ARGS__)); \ + } + # define PROBE_QUIET(NAME, FMT, ...) \ if (LIBVIRT_ ## NAME ## _ENABLED()) { \ PROBE_EXPAND(LIBVIRT_ ## NAME, \ @@ -101,5 +110,10 @@ __FILE__, __LINE__, __func__, \ #NAME ": " FMT, __VA_ARGS__); +# define PROBE_DEBUG(NAME, FMT, ...) \ + VIR_DEBUG_INT(&virLogSelf, \ + __FILE__, __LINE__, __func__, \ + #NAME ": " FMT, __VA_ARGS__); \ + # define PROBE_QUIET(NAME, FMT, ...) #endif -- 2.54.0
