A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2002-March/021531.html below:

PEP 282 comments (Jeremy Hylton)

[Python-Dev] Re: PEP 282 comments (Jeremy Hylton)Kevin Butler kbutler@campuspipeline.com
Wed, 20 Mar 2002 18:59:24 -0700
From: "Jeremy Hylton" <jeremy@zope.com>

> I really like the shorthands for log levels, e.g.
> logger.debug() instead of logger.log(DEBUG, ...).  So I'd be
> disappointed if I couldn't use it when I want to log an
> exception.

+1

Conceptually, I'm logging a debug message (or
error message, or warning), and want to include exception 
information. The optional named argument allows all the
levels to provide exception logging easily and consistently,
without cluttering the interface with lots of "levelEx" methods.

I'd probably spell it:
class Logger:
  def debug( msg, exc=None ):
      ...

log.debug( msg, exc=sys.exc_info() )

Or possibly:
  log.debug( msg, exc=1 )

to have the logger call sys.exc_info()

kb

PS. As this is my first post to Python-dev, here's the ObBriefIntro:

I've been using Python for several years, I actually first played
with Python because of a web search hit on the "soundex" module, 
of all things (soundex was disappointing, Python was not...). I rapidly
moved on to doing CORBA, Java, GUI, WWW, and RDB work with Python, and now 
tend to use Jython extensively.





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4