X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/f6ee24a2b56b9365b948dd9e501c0e4627e6fa4f..e1d04f48a45c9f8e8ff75610003048f8ead73219:/src/src/debug.c diff --git a/src/src/debug.c b/src/src/debug.c index 8f9359b15..3cd6d0c92 100644 --- a/src/src/debug.c +++ b/src/src/debug.c @@ -137,7 +137,7 @@ debug_printf("%s uid=%ld gid=%ld euid=%ld egid=%ld\n", s, *************************************************/ /* There are two entries, one for use when being called directly from a -function with a variable argument list. +function with a variable argument list, one for prepending an indent. If debug_pid is nonzero, print the pid at the start of each line. This is for tidier output when running parallel remote deliveries with debugging turned on. @@ -146,6 +146,28 @@ get interleaved. Since some calls to debug_printf() don't end with newline, we save up the text until we do get the newline. Take care to not disturb errno. */ + +/* Debug printf indented by ACL nest depth */ +void +debug_printf_indent(const char * format, ...) +{ +va_list ap; +unsigned depth = acl_level + expand_level, i; + +if (!debug_file) return; +if (depth > 0) + { + for (i = depth >> 2; i > 0; i--) + fprintf(debug_file, " ."); + fprintf(debug_file, "%*s", depth & 3, ""); + } + +va_start(ap, format); +debug_vprintf(format, ap); +va_end(ap); +} + + void debug_printf(const char *format, ...) {