parameters to logging.debug()

Michael Hoffman m.h.3.9.1.without.dots.at.cam.ac.uk at example.com
Tue Oct 26 18:32:41 CEST 2004


Winston WOLFF wrote:
> What do people think about changing the parameters to logging.debug() to 
> be more like the parameters to print?

I think it will break a lot of software that uses the current API.

> Also, for those who like the second format better, you can always type:
>     log.debug( "index=%i  dict=%s  x=%d y=%d z=%d" % ( i, dict, x, y, z) )

That argument could also be made about your proposal. You can always type:

log.debug(" ".join(map(str, ("index=",i, "dict=", dict, "x=", x, "y=", 
y, "z=", z))))

(Isn't Python going to start auto-stringizing the items in a join 
sometime soon?)

Or better yet, you can subclass your own logger that does this 
automatically. That's one of the reasons the logging stuff is so 
extensible ;-)
-- 
Michael Hoffman



More information about the Python-list mailing list