Log::Log4perl solves this elegantly by providing a singleton. So you can add logging whereever you want simply by calling get_logger).
How is calling my $log = Log::Log4perl->get_logger("My::MegaPackage") in every function or method: elegant?
Surely they could have fitted another couple of "log"s in there somewhere.
Maybe my $log_logger = Log::Log4perl->get_log_logger( ... )
In reply to Re: Global or not global
by BrowserUk
in thread Global or not global
by McA
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |