aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2014-11-06 14:59:06 +0000
committerWerner Koch <[email protected]>2014-11-06 14:59:06 +0000
commit8031341283f4fcb1f226aa6f66bc5a6042586815 (patch)
treeea58c6d65c9fddf1f009b110d405a929ad636544
parentbuild: Implement SYSROOT feature. (diff)
downloadgpgme-8031341283f4fcb1f226aa6f66bc5a6042586815.tar.gz
gpgme-8031341283f4fcb1f226aa6f66bc5a6042586815.zip
Improve the debug output a bit.
* src/debug.h (TRACE_ERR): Include the line number in the output.
-rw-r--r--doc/gpgme.texi3
-rw-r--r--src/debug.h4
2 files changed, 4 insertions, 3 deletions
diff --git a/doc/gpgme.texi b/doc/gpgme.texi
index b23e7b11..45c359d0 100644
--- a/doc/gpgme.texi
+++ b/doc/gpgme.texi
@@ -6089,7 +6089,8 @@ may use @acronym{GPGME}'s built in trace feature. This feature is
either enabled using the environment variable @code{GPGME_DEBUG} or,
if this is not possible, by calling the function
@code{gpgme_set_global_flag}. The value is the trace level and
-an optional file name.
+an optional file name. If no file name is given the trace output is
+printed to @code{stderr}.
@noindent
For example
diff --git a/src/debug.h b/src/debug.h
index c99b7003..d0db5736 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -187,8 +187,8 @@ _gpgme_trace_gpgme_error (gpgme_error_t err, const char *file, int line)
#define TRACE_ERR(err) \
err == 0 ? (TRACE_SUC ()) : \
- (_gpgme_debug (_gpgme_trace_level, "%s: error: %s <%s>\n", \
- _gpgme_trace_func, gpgme_strerror (err), \
+ (_gpgme_debug (_gpgme_trace_level, "%s:%d: error: %s <%s>\n", \
+ _gpgme_trace_func, __LINE__, gpgme_strerror (err), \
gpgme_strsource (err)), _gpgme_debug_frame_end (), (err))
/* The cast to void suppresses GCC warnings. */
#define TRACE_SYSRES(res) \