aboutsummaryrefslogtreecommitdiffstats
path: root/src/debug.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2018-11-02 08:03:43 +0000
committerWerner Koch <[email protected]>2018-11-02 08:03:43 +0000
commit337c10825525d4084f3f437fde5af3806707e6a4 (patch)
treef4ee8b556665f005dc548ab0a007d521b64ff7de /src/debug.h
parentw32: Fix and improve CancelSynchronousIo use. (diff)
downloadgpgme-337c10825525d4084f3f437fde5af3806707e6a4.tar.gz
gpgme-337c10825525d4084f3f437fde5af3806707e6a4.zip
core: Print a dump of the I/O data only at level 8.
* src/debug.h (TRACE_SUC3): New. (TRACE_LOGBUFX): New. * src/posix-io.c: Use TRACE_LOGBUFX instead of TRACE_LOGBUF. * src/w32-glib-io.c: Ditto. -- This will also be changed for w32-io as part of another commit. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'src/debug.h')
-rw-r--r--src/debug.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/debug.h b/src/debug.h
index ca65d9ed..ecd230f6 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -34,7 +34,11 @@
#define XSTRINGIFY(v) STRINGIFY(v)
-/* The debug levels. */
+/*
+ * The debug levels.
+ *
+ * Note that TRACE_LOGBUFX uses the current debug level + 1.
+ */
#define DEBUG_INIT 1
#define DEBUG_GLOBAL 2
@@ -211,6 +215,9 @@ _gpgme_trace_gpgme_error (gpgme_error_t err, const char *file, int line)
#define TRACE_SUC2(fmt, arg1, arg2) \
_gpgme_debug (_gpgme_trace_level, "%s: leave: " fmt "\n", \
_gpgme_trace_func, arg1, arg2), _gpgme_debug_frame_end ()
+#define TRACE_SUC3(fmt, arg1, arg2, arg3) \
+ _gpgme_debug (_gpgme_trace_level, "%s: leave: " fmt "\n", \
+ _gpgme_trace_func, arg1, arg2, arg3), _gpgme_debug_frame_end ()
#define TRACE_SUC4(fmt, arg1, arg2, arg3, arg4) \
_gpgme_debug (_gpgme_trace_level, "%s: leave: " fmt "\n", \
_gpgme_trace_func, arg1, arg2, arg3, arg4), \
@@ -256,6 +263,10 @@ _gpgme_trace_gpgme_error (gpgme_error_t err, const char *file, int line)
_gpgme_debug_buffer (_gpgme_trace_level, "%s: check: %s", \
_gpgme_trace_func, buf, len)
+#define TRACE_LOGBUFX(buf, len) \
+ _gpgme_debug_buffer (_gpgme_trace_level+1, "%s: check: %s", \
+ _gpgme_trace_func, buf, len)
+
#define TRACE_SEQ(hlp,fmt) \
_gpgme_debug_begin (&(hlp), _gpgme_trace_level, \
"%s: check: %s=%p, " fmt, _gpgme_trace_func, \