[python-win32] Shell extension debugging

Thomas Heller theller at ctypes.org
Tue Jun 30 14:47:21 CEST 2009


Gertjan Klein schrieb:
>>> 2) I see print statements in the source code, but I have no idea where
>>> they go; I checked the event log, but they are not there. Are they
>>> logged anywhere? If not, why are they there to begin with?
>>>
>>> Any other tip on how to effectively debug this stuff would be most
>>> welcome as well.
>>
>>The print statements go into empty space because there is no stdout for
>>that process.  You can try using the logging module to log to a file, or
>>you can use ctypes to write to kernel32.OutputDebugString and using a
>>kernel debug log monitor to read them.
> 
> The logging module reminds me of Java too much. :(  I think I'll try to
> write to a file, I have no idea if I have a kernel debug log monitor.

For stuff like this you should look around at the sysinternals site.  They have
a DebugView utility that displays these log strings.  ProcessExplorer is also
a very nice and useful replacement or addition for the task manager.

Thomas



More information about the python-win32 mailing list