Logging errors to a file

Gabriel Genellina gagsl-py at yahoo.com.ar
Sun Feb 18 23:52:10 EST 2007


En Mon, 19 Feb 2007 00:00:35 -0300, Harlin Seritt <harlinseritt at yahoo.com>  
escribió:

> Is there any way to automatically log errors that occur within an
> executed script to a file?

The logging module. You may want to enclose your main entry point in a  
try/except block, just to be sure you catch everything. (*Almost*  
everything; a multithreaded program may require additional catching of  
errors)

-- 
Gabriel Genellina




More information about the Python-list mailing list