[Koha-bugs] [Bug 16304] Koha::Logger, lazy load loggers so environment has time to get set

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Apr 20 10:34:54 CEST 2016


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16304

--- Comment #2 from Olli-Antti Kivilahti <olli-antti.kivilahti at jns.fi> ---
You can also circumvent this environment setting problem with this code block:


Use C4::Context;
BEGIN {
    C4::Context->interface('commandline');
}
use Logger_Invoking_Module;


But this is dependent on the load order of Perl modules and is practically
impossible to know if you are just starting to work with Koha / new to Perl.


BEGIN {
    C4::Context->interface('commandline');
}
Use C4::Context;
use Logger_Invoking_Module;


This no longer works.

Also lazyLoading saves CPU time on package-level $loggers which might not get
used.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list