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/2010-December/106593.html below:

[Python-Dev] Using logging in the stdlib and its unit tests

[Python-Dev] Using logging in the stdlib and its unit tests [Python-Dev] Using logging in the stdlib and its unit testsVinay Sajip vinay_sajip at yahoo.co.uk
Wed Dec 8 20:42:00 CET 2010
 <skip <at> pobox.com> writes:

>     >>> 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.

Yes, and the string expansion normally is deferred to happen as late as possible.

Regards,

Vinay


More information about the Python-Dev mailing list

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