Open LukeShu opened 2 years ago
At one point someone benchmarked that...
That would be me. 🙂 And the self.debug
or self._log_debug
shortcut was about typing fewer characters, and about not constantly making the function call for logger.isEnabledFor(level)
.
If you look at the history, you'll see more than a few places where I later undid that wrapper in favor of the old-school "%s", arg
-style logging... but yeah, it was never worth finding them all, and there are still places where the wrapper is better just because there's so much logging we want to do in debug mode.
All that said, though: yeah. We should run PyLint.
Right now, there are lots of log statements that use f-strings or
%
expressions that ~expensively evaluate, just to be discarded by the logger because of the log level. At one point someone benchmarked that and figured out that we'd get substantial gains from wrapping a bunch of those in calls tologger.isEnabledFor(level)
. Well, that's not necessary; the logger can do that for us, if we let it defer the formatting to the logger.@haq204 wrote:
@LukeShu wrote:
It looks like this is what PyLint W1202 is checking for. We should start running PyLint.