From 088d71d3671e74eb088386026f0e439a7e3b5543 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 11 Jan 2017 10:21:32 +0100 Subject: common: New function log_debug_with_string. * common/logging.c (do_logv): Factor some code out to ... (print_prefix): new. (log_logv): Add arg EXTRASTRING and print it. Change all callers to pass NULL for it. (log_debug_with_string): New. Uses EXTRASTRING. -- This function can be used to print a human readable buffer in addition to a log message to the log stream. This function will keep all lines together and prefix them with ">> ". Signed-off-by: Werner Koch --- common/logging.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common/logging.h') diff --git a/common/logging.h b/common/logging.h index 8edc5c9c7..ed1d3b972 100644 --- a/common/logging.h +++ b/common/logging.h @@ -96,6 +96,8 @@ void log_fatal (const char *fmt, ...) GPGRT_ATTR_NR_PRINTF(1,2); void log_error (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2); void log_info (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2); void log_debug (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2); +void log_debug_with_string (const char *string, const char *fmt, + ...) GPGRT_ATTR_PRINTF(2,3); void log_printf (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2); void log_flush (void); -- cgit v1.2.3