Popular recipes tagged "exception" and "logging" but not "handler"http://code.activestate.com/recipes/tags/exception-handler+logging/popular/2010-04-06T20:40:05-07:00ActiveState Code RecipesEasy Exception, Error Handling and Debugging with Auto Logging (Python)
2010-04-06T20:40:05-07:00AJ. Mayorgahttp://code.activestate.com/recipes/users/4173476/http://code.activestate.com/recipes/577144-easy-exception-error-handling-and-debugging-with-a/
<p style="color: grey">
Python
recipe 577144
by <a href="/recipes/users/4173476/">AJ. Mayorga</a>
(<a href="/recipes/tags/debug/">debug</a>, <a href="/recipes/tags/debugging/">debugging</a>, <a href="/recipes/tags/error_propagation/">error_propagation</a>, <a href="/recipes/tags/exception/">exception</a>, <a href="/recipes/tags/logging/">logging</a>).
Revision 5.
</p>
<p>Being new to Python and trying to chase where in my project exceptions were taking place always seems to take up a large amount of time. So I created this class that I now pretty use in all my projects to help me save time tracking exceptions and errors. its also has the ability to generate error logs or to output SQL query and data tuples for Database logging. Ive added sample code to give you an idea of how I normally use it. Hope this helps its saved me hours in tracking error/exception. Feed back would be great, mind you havent been Python all that long</p>
self-logging exceptions (Python)
2009-05-27T17:43:56-07:00geremy condrahttp://code.activestate.com/recipes/users/4170000/http://code.activestate.com/recipes/576781-self-logging-exceptions/
<p style="color: grey">
Python
recipe 576781
by <a href="/recipes/users/4170000/">geremy condra</a>
(<a href="/recipes/tags/exception/">exception</a>, <a href="/recipes/tags/logging/">logging</a>).
Revision 3.
</p>
<p>Pretty frequently I find myself needing to log my exceptions, and rather than produce a tangled mess of boilerplate code, I went ahead and put together this snippet to act as a base class for all those exceptions.</p>