>> On a slightly tangential note, what do you think of the idea of
    >> library code including info or debug level logging? In effect,
    >> tracing and diagnostic code built in and available simply by changing
    >> the logging level?

    Vinay> That's how it works right now. You get info() and debug()
    Vinay> messages sent via calls in library code, just by changing the
    Vinay> level of (say) the root logger.

There can be performance implications if you log heavily.  I don't know how
the code is organized, but functionally these two calls are equivalent:

    >>> logging.error("error 1 2 3 %s" % "yup")
    ERROR:root:error 1 2 3 yup
    >>> logging.error("error 1 2 3 %s", "yup")
    ERROR:root:error 1 2 3 yup

The second form should be preferred in library code as long as the format
string expansion is deferred until after the test is made to emit the
message.

Skip
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to