Home - Waterfall Grid T-Grid Console Builders Recent Builds Buildslaves Changesources - JSON API - About

Change #6268

Category None
Changed by John Merriam <jmerriamohnoyoudont@biblio.org>
Changed at Fri 07 Jun 2019 11:11:13
Repository git://git.evergreen-ils.org/OpenSRF.git
Project OpenSRF
Branch master
Revision 9a90f826e18b42ce6f508064c3ad68cf6d6c7c0a

Comments

LP#1824181: Allow 1st arg to logger to be string or subroutine
This simple change allows the $msg passed to _log_message in Logger.pm
to be either a regular string or a delayed exec subroutine. This is in
reaction to LP1823338 where a slow debug logging statement was slowing
down SIP checkins even though debug logging was not turned on.

With this change you can take this:

$log->debug("Available methods\n\t".join("\n\t", keys %{ $_METHODS[$proto] }), INTERNAL);

and change it to this:

$log->debug(sub{return "Available methods\n\t".join("\n\t", keys %{ $_METHODS[$proto] }) }, INTERNAL);

and then that slow debug logging line will not be executed unless
debug logging is turned on.

Signed-off-by: John Merriam <jmerriam@biblio.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>

Changed files