[PATCH 3/5] Modify how we call logging functions to take a list of parameters.

Vratislav Podzimek vpodzime at redhat.com
Thu Aug 22 09:45:16 UTC 2013


On Wed, 2013-08-21 at 09:46 -0400, David Shea wrote:
> On 08/21/2013 03:06 AM, Vratislav Podzimek wrote:
> > On Tue, 2013-08-20 at 14:42 -0400, Chris Lumens wrote:
> >> This is instead of doing the string substitution before passing the whole
> >> thing to the logging function.
> > What is the reason behind this change? I've never seen pylint
> > complaining about those lines and I think the substitution is more
> > pythonic and more common.
> >
> It's to reduce the evaluation of unused expressions. With the existing 
> code the string substitution would always occur, even if messages at 
> that particular level are set not to be logged. Passing as parameters 
> lets the logging module decide whether or not to perform that operation.
That would be nice, but we log everything from DEBUG to ERROR in every
case so it won't make a difference, I guess. But probably a good step
towards smaller logging overhead.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list