From: <msc...@ao...> - 2002-09-24 03:16:02
|
In a message dated Mon, 23 Sep 2002 8:59:31 PM Eastern Standard Time, mrd...@ya... writes: >Couldn't the interface be simpler? > use Log::Log4perl::EZ; > ... > DEBUG("New food: $what"); # Or Debug() or debug() Funny, a couple of weeks ago I had exactly that in there. However, there was some resistance on log4perl-devel (Kevin!!!:) arguing that we need to educate people to explicitely state the category (which could be very different from the package name BTW). The other argument against the 'EZ' interface was that something like DEBUG("Something happened!!!"); # ... DEBUG("Something else!!!"); needs to call get_logger() twice behind the scenes, which is un peu slower than my $logger = get_logger("Blah::Poo"); $logger->debug("Something happened!!!"); # ... $logger->debug("Something else!!!"); which just obtains the logger instance once. Which could have a significant impact if there are 20 debug statements within one function. I guess there's always a tradeoff -- but if one more person asks for it, I'll hammer it in, you've been warned :). -- -- Mike ############################ # Mike Schilli # # log...@pe... # # http://perlmeister.com # # log4perl.sourceforge.net # ############################ |