MS RFC 28: Redesign of LOG/DEBUG output mechanisms
Tamas Szekeres
szekerest at GMAIL.COM
Fri Jun 15 13:59:40 EDT 2007
2007/6/15, Daniel Morissette <dmorissette at mapgears.com>:
> I guess I didn't make that clear in the RFC, but my intention was to
> have the file handle global for a given request only, but not global
> across threads. I plan to do that by using the same mechanism that we
> already use in msGetErrorObj() (maperror.c) to have a single error stack
> per thread. Since this code seems to have worked well for a while I
> didn't expect any issue with handling the file handle the same way.
>
Yes it makes sense. (Maintaing different handles for the different
threads in a common repository and using locks when accessing the
repository)
> Can you provide a code sample that shows the use of OutputDebugString?
> Could it be as simple as having another special keyword for the
> MS_ERRORFILE value, for instance "windowsdebug", that sends output to
> this system? If the mechanism works in a similar way as writing to a
> file and doesn't require changing too much stuff and you can provide
> code samples that use it then I'm willing to try including this in the RFC.
>
You should simply call the non unicode variant, like:
#ifdef WIN32
#include <windows.h>
void writeDebug( const char * pszMessage)
{
OutputDebugStringA(pszMessage);
}
#endif
For more info http://msdn2.microsoft.com/en-us/library/aa363362.aspx
The "windowsdebug" option would be fine.
Best regards,
Tamas
More information about the mapserver-dev
mailing list