> Peter> Monty,
> Peter> Only DM logging is making it to log file. I think this has something to
> Peter> do with using stuff like stderr as the TraceFile while in unixODBC we
> Peter> assume a real file name so I put;
>
> Peter> Trace = Yes
> Peter> TraceFile = /home/pharvey/SQL.LOG
>
> Peter> unixODBC kinda expects that the Driver will call
> Peter> SQLGetPrivateProfileString() in SQLConnect() to get the file name and
> Peter> init logging accordingly. I am not sure what is going on, is this
> Peter> regard, in MyODBC.
>
> Peter> Any comments?
>
> Peter> Peter Harvey
>
> Sorry ; MySQL doesn't use SQLGetPrivateProfileString() for debugging.
> (I just haven't had time to fix this). If you can show me some code
> how this is down, I will fix it at once!
>
> If MyODBC is compiled with debugging, you only have to do the
> following to initalize it:
>
> export MYODBC_LOG=d:t:o,/tmp/myodbc.trace
>
> to get a very useful trace in /tmp/myodbc.trace
>
Monty,
Here is something that should work for unixODBC users but I am not familiar with
DBUG_* functions. For example; DBUG_PUSH() gets the driver logging going to
SQL.LOG but it does not behave very well... it starts a new log which trounces
all previous logging.
char szTRACE[FILENAME_MAX+1] = "";
char szTRACEFILE[FILENAME_MAX+1] = "";
char szMYODBC_LOG[FILENAME_MAX+20]= "";
SQLGetPrivateProfileString( dsn_ptr, "TRACE", "", szTRACE, sizeof(szTRACE),
"ODBC.INI" );
if ( szTRACE[0] == '1' || toupper(szTRACE[0]) == 'Y' || toupper(szTRACE[0]) ==
'O' )
{
SQLGetPrivateProfileString( dsn_ptr, "TRACEFILE", "", szTRACEFILE,
sizeof(szTRACEFILE), "ODBC.INI" );
if ( *szTRACEFILE )
{
sprintf( szMYODBC_LOG, "d:t:S:O,%s", szTRACEFILE );
/* setenv( "MYODBC_LOG", szMYODBC_LOG, 1 ); */
DBUG_PUSH(szMYODBC_LOG);
}
}
Nick,
Should we be using...
if ( *szTRACE ) and if ( *szTRACEFILE )
when checking if we have an empty string (this is in the DM).
Peter Harvey