[unixODBC-support] driver logging

Nick Gorham nick.gorham at easysoft.com
Tue Mar 1 17:23:50 GMT 2005


Eric Sharkey wrote:

>The template driver distributed with unixODBC integrates facilities
>for logging information from within the driver, but there doesn't
>really seem to be any way to control this functionality.  The logical
>thing would be to have the driver respond to SQL_ATTR_TRACE, and
>SQL_ATTR_TRACEFILE connection attributes, but the DM intercepts these
>calls and never passes them on to the driver.  Do you guys have any
>thoughts on this?
>  
>

Well, I tried to replicate what the MS DM does, those two att's control 
DM logging. What the driver can do, is to look at the DM variable 
ODBCSharedTraceFlag and use that to turn its logging on and off, this 
again is the same as under windows AFAIK

>What is the advantage of storing log messages in memory?  The
>template keeps up to 50 messages in RAM per handle and never seems
>to do anything with them.  Is there a point to this?  Just to
>have them there if you attach a debugger?
>  
>
Well, I have to admit, I inhereited the logging code from peter, and saw 
this was what it did, but I am unsure what will break outside of the dm 
if I change this, as I found it was using this storage in other things,

>Why do the log facilities require a sprintf to an external buffer
>prior to logPushMsg?  Isn't it better to have logPushMsg take
>a variable argument list and call vsnprintf/vfprintf rather than
>strdup/fprintf?
>  
>
Yes, but not all platforms have a vsnprintf/vfprintf, thats (if I 
remember) why it was done that way.

-- 
Nick



More information about the unixODBC-support mailing list