aboutsummaryrefslogtreecommitdiffstats
path: root/common/logging.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2017-01-11 09:21:32 +0000
committerWerner Koch <[email protected]>2017-01-11 09:42:44 +0000
commit088d71d3671e74eb088386026f0e439a7e3b5543 (patch)
treea128e7867c7b6a0156fb253223b5aed6764cd738 /common/logging.h
parentcommon: Avoid unnecessary ambiguity in argparse. (diff)
downloadgnupg-088d71d3671e74eb088386026f0e439a7e3b5543.tar.gz
gnupg-088d71d3671e74eb088386026f0e439a7e3b5543.zip
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 <[email protected]>
Diffstat (limited to '')
-rw-r--r--common/logging.h2
1 files changed, 2 insertions, 0 deletions
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);