Only print the trace header when we are at the beginning of a new

line (suggested by Dimitrie O. Paun).
This commit is contained in:
Alexandre Julliard 2003-03-14 04:02:03 +00:00
parent 1efa50e47e
commit 949e065c49
1 changed files with 10 additions and 5 deletions

View File

@ -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, static int NTDLL_dbg_vlog( unsigned int cls, const char *channel,
const char *function, const char *format, va_list args ) 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; int ret = 0;
if (TRACE_ON(tid)) /* only print header if we are at the beginning of the line */
ret = wine_dbg_printf( "%04lx:", NtCurrentTeb()->tid ); if (info->out_pos == info->output || info->out_pos[-1] == '\n')
if (cls < sizeof(classes)/sizeof(classes[0])) {
ret += wine_dbg_printf( "%s:%s:%s ", classes[cls], channel + 1, function ); 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) if (format)
ret += NTDLL_dbg_vprintf( format, args ); ret += NTDLL_dbg_vprintf( format, args );
return ret; return ret;