A RetroSearch Logo

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

Search Query:

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

[Python-Dev] Re: PEP 282 comments

[Python-Dev] Re: PEP 282 comments [Python-Dev] Re: PEP 282 commentsMark Hammond mhammond@skippinet.com.au
Thu, 21 Mar 2002 12:04:23 +1100
[Trent]

> How about this (just an idea):
>     def info(self, msgOrException, *args):
>         if isinstance(msgOrException, Exception):
>             # format the exception and
>             msg, args = args[0], args[1:]
>         else:
>             # treat it like before
>
>     try:
>         # ...
>     except Exception, ex:
>         log.info(ex, "Eeeeek!")

I don't like this.  I think it rare you will want to log an exception with
no contextual message.

Eg,

  info(sys.exc_info())

Would be pretty useless in a log.  You would also want to include *what*
went wrong (whereas the exception generally only tells you *why* (and where)
it went wrong.

Mark.




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