From 949e065c4971996a63b2c1ae3462d995601d74cf Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 14 Mar 2003 04:02:03 +0000 Subject: [PATCH] Only print the trace header when we are at the beginning of a new line (suggested by Dimitrie O. Paun). --- dlls/ntdll/debugtools.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/dlls/ntdll/debugtools.c b/dlls/ntdll/debugtools.c index 3cb26f77513..2f0f292a1f5 100644 --- a/dlls/ntdll/debugtools.c +++ b/dlls/ntdll/debugtools.c @@ -303,13 +303,18 @@ static int NTDLL_dbg_vprintf( const char *format, va_list args ) static int NTDLL_dbg_vlog( unsigned int cls, const char *channel, const char *function, const char *format, va_list args ) { - static const char *classes[] = { "fixme", "err", "warn", "trace" }; + static const char * const classes[] = { "fixme", "err", "warn", "trace" }; + struct debug_info *info = get_info(); int ret = 0; - if (TRACE_ON(tid)) - ret = wine_dbg_printf( "%04lx:", NtCurrentTeb()->tid ); - if (cls < sizeof(classes)/sizeof(classes[0])) - ret += wine_dbg_printf( "%s:%s:%s ", classes[cls], channel + 1, function ); + /* only print header if we are at the beginning of the line */ + if (info->out_pos == info->output || info->out_pos[-1] == '\n') + { + if (TRACE_ON(tid)) + ret = wine_dbg_printf( "%04lx:", NtCurrentTeb()->tid ); + if (cls < sizeof(classes)/sizeof(classes[0])) + ret += wine_dbg_printf( "%s:%s:%s ", classes[cls], channel + 1, function ); + } if (format) ret += NTDLL_dbg_vprintf( format, args ); return ret;