win32gui.set_logger

set_logger(logger)

Sets a logger object for exceptions and error information

Parameters

logger : object

A logger object, generally from the standard logger package.

Comments

Once a logger has been set for the module, unhandled exceptions, such as from a window's WNDPROC, will be written (via logger.exception()) to the log instead of to stderr.
Note that using this with the Python 2.3 logging package will prevent the traceback from being written to the log. However, it is possible to use the Python 2.4 logging package directly with Python 2.3