[unixODBC-support] driver logging

Nick Gorham nick.gorham at easysoft.com
Tue Mar 1 21:21:03 GMT 2005


Eric Sharkey wrote:

>>the start of dm_log_write contains
>>
>>    if ( !log_info.log_flag && !ODBCSharedTraceFlag )
>>        return;
>>
>>So if logging is off there is no call to sprintf.
>>    
>>
>
>I'm talking about driver logging, not driver manager logging.
>
>If you look at, for example, SQLConnect.c in unixODBC/Drivers/template:
>
>  
>
Oh, ok, fair enough. I agree as its a example driver, its worth setting 
a good example :-)

>If logPushMsg took variable arguments, the last two lines could look like :
>
>	logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,
>                    "hDbc=$%08lX 3zDataSource=(%s)",hDbc, szDataSource );
>  
>
Yep. However beware, you have to make sure the varargs stuff and the 
vsnprintf works on some of the odd platforms that people use this stuff 
on. unfortunatly, people only seem to build on them when we do releases, 
not the pre release stuff...

Maybe having a vlogPushMsg would be a way of doing this.

-- 
Nick



More information about the unixODBC-support mailing list