IMHO when you have decided to use Log::Log4perl then it is in the installation prerequisites. To have a function name like 'get_logger' is unique enough for loading it in your current namespace. When Log::Log4perl is not initialized, the code doesn't hurt. So, whenever I need an additional log statement, I just insert get_logger->error("Somewhat");use Log::Log4perl qw(get_logger :nowarn); ... get_logger->info("Shit happens");
That what I meant with 'elegant'. Or call is 'handy'.
What is your solution to those cross cutting concerns like logging?
Best regardsIn reply to Re^2: Global or not global
by McA
in thread Global or not global
by McA
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |