Comment 7 for bug 1840053

Revision history for this message
Bill Erickson (berick) wrote : Re: [Bug 1840053] Re: Change potentially slow log statements to subroutines

On Thu, Apr 7, 2022 at 1:11 PM John Merriam <email address hidden>
wrote:

> It may be a bit slower. The idea was to try to not call potentially
> slow methods gathering things for logging when we aren't running at a
> log level where they would actually be logged.
>

Right, and like I said, other work flows may benefit, possibly a lot. I
was just surprised the first thing I tested was a hair slower and it gives
me pause. Maybe the patch could be more targeted?

>
> Another approach would be to export the global logging level from the
> logging module and then put if statements around all logging code above
> log level error.
>

I could certainly see this helping. We take a similar approach in
OpenSRF's Server module. See the $chatty variable -- which, incidentally,
is enabled by default.

https://git.evergreen-ils.org/?p=OpenSRF.git;a=blob;f=src/perl/lib/OpenSRF/Server.pm;h=52c53d244c63a91bc1364ca471b6a1ae09dfc0e9;hb=refs/heads/master