aboutsummaryrefslogtreecommitdiffstats
path: root/common/logging.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/logging.c')
-rw-r--r--common/logging.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/common/logging.c b/common/logging.c
index df55e6827..7fe8b7419 100644
--- a/common/logging.c
+++ b/common/logging.c
@@ -1011,10 +1011,17 @@ log_flush (void)
dump, with TEXT just an empty string, print a trailing linefeed,
otherwise print an entire debug line. */
void
-log_printhex (const char *text, const void *buffer, size_t length)
+log_printhex (const void *buffer, size_t length, const char *fmt, ...)
{
- if (text && *text)
- log_debug ("%s ", text);
+ if (fmt && *fmt)
+ {
+ va_list arg_ptr ;
+
+ va_start (arg_ptr, fmt);
+ do_logv (GPGRT_LOG_DEBUG, 0, NULL, NULL, fmt, arg_ptr);
+ va_end (arg_ptr);
+ log_printf (" ");
+ }
if (length)
{
const unsigned char *p = buffer;
@@ -1022,7 +1029,7 @@ log_printhex (const char *text, const void *buffer, size_t length)
for (length--, p++; length--; p++)
log_printf (" %02X", *p);
}
- if (text)
+ if (fmt)
log_printf ("\n");
}