Oleaut32 Debug Messages
Alexandre Julliard
julliard at winehq.com
Thu Mar 13 12:38:44 CST 2003
"Dimitrie O. Paun" <dpaun at rogers.com> writes:
> If we detect that we're appending, we just have to skip
> over the class:channel:function preamble (that's trivial,
> the preamble ends at the first space (' ')).
>
> This way we can eliminate the DPRINTF macro which is
> rarely used, and thus confusing. Alexandre?
No objection. Something like this should do the trick:
Index: dlls/ntdll/debugtools.c
===================================================================
RCS file: /opt/cvs-commit/wine/dlls/ntdll/debugtools.c,v
retrieving revision 1.28
diff -u -r1.28 debugtools.c
--- dlls/ntdll/debugtools.c 18 Feb 2003 23:29:48 -0000 1.28
+++ dlls/ntdll/debugtools.c 13 Mar 2003 18:36:05 -0000
@@ -304,12 +304,17 @@
const char *function, const char *format, va_list args )
{
static const char *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;
--
Alexandre Julliard
julliard at winehq.com
More information about the wine-devel
mailing list