[Python-Dev] Re: PEP 282 comments (original) (raw)

Barry A. Warsaw barry@zope.com
Thu, 21 Mar 2002 09:55:46 -0500


"TM" == Trent Mick <trentm@ActiveState.com> writes:

TM> Jeremy, The methods use 'msg, *args' instead of just 'msg' to
TM> avoid string interpolation if the message will not be logged.
TM> I think that that is still important to keep, albeit it making
TM> the 'exc' keyword argument less explicit.

I really like my logging interface, which also uses *args. This just seems really convenient, and like you said, allows you to avoid some extra work if the logging is disabled:

syslog('vette', 'banned subscription: %s (matched: %s)',
                 email, pattern)

(There's a mismatch in my API and the PEP 282 API: `syslog' is a global Logger instance that takes the file to log to -- relative to a known directory -- as its first argument. I don't think this is insurmountable.)

-Barry