start/stop logs by code... is it possible ?

Massimo Del Fedele max at veneto.com
Thu Jul 3 06:26:40 CDT 2008


Thank to all that answered to my questions !
I'll test it on nexd days.

Best Regards

Max


Michael Karcher ha scritto:
> Am Donnerstag, den 03.07.2008, 01:36 +0200 schrieb Massimo Del Fedele:
>>> Try these untested macros:
>>>
>>> #define STARTLOG(dbch) ((_wine_dbch_##dbch).flags |= (1 << __WINE_DBCL_TRACE))
>>> #define STOPLOG(dbch) ((_wine_dbch_##dbch).flags &= ~(1 << __WINE_DBCL_TRACE))
>>>
>>> And then use them like this:
>>> void aWineFunction(...)
>>> {
>>>   .......
>>>   STARTLOG(relay)
>>>   .......
>>>   .......
>>>   STOPLOG(relay)
>>>
>>>   .......
>>> }
>> Thanx for the answer !
>> What I'm interested for is a trace, not a relay... can it work for 
>> traces too ? which would be the syntax then ?
> 
> The contents of this mail are also untestet, so beware.
> 
> It probably will work even better. You just have to put the channel name
> (without quotes, so not as string) as argument to the STARTLOG and
> STOPLOG macros. It does not work with relay, because the thunks that
> print relay info are built at dll load time, and I don't expect the
> TRACE_ON(relay) information to be tested on each function call. If
> during DLL load TRACE_ON(relay) is true, this DLL will (during the whole
> process lifetime) generate relay info and if TRACE_ON(relay) was of at
> that time, no relay-printing thunks are built and it is pointless to
> turn it on later.
> 
> Regards,
>   Michael Karcher
> 
> 
> 
> 




More information about the wine-devel mailing list