ntdll: Add timestamp channel to log output.

Dmitry Timoshkov dmitry at codeweavers.com
Tue Jun 24 22:14:16 CDT 2008


"Peter Urbanec" <winehq.org at urbanec.net> wrote:

> @@ -164,8 +166,16 @@ static int NTDLL_dbg_vlog( enum __wine_debug_class cls, struct __wine_debug_chan
>     /* only print header if we are at the beginning of the line */
>     if (info->out_pos == info->output || info->out_pos[-1] == '\n')
>     {
> +        /* Prepend a timestamp to each line, if requested. */
> +        if (TRACE_ON(timestamps))
> +        {
> +          struct timeval tv;
> +          if (!gettimeofday(&tv, NULL))
> +            ret += wine_dbg_printf( "[%ld.%06ld] ", tv.tv_sec, tv.tv_usec);
> +        }
> +
>         if (TRACE_ON(tid))
> -            ret = wine_dbg_printf( "%04x:", GetCurrentThreadId() );
> +            ret += wine_dbg_printf( "%04x:", GetCurrentThreadId() );
>         if (cls < sizeof(classes)/sizeof(classes[0]))
>             ret += wine_dbg_printf( "%s:%s:%s ", classes[cls], channel->name, function );
>     }

What about using the same indentation style as the existing code does?

-- 
Dmitry.



More information about the wine-devel mailing list