From: Jim C. <jc...@di...> - 2003-01-25 23:36:20
|
Msc...@ao... wrote: > In a message dated 1/24/03 5:44:19 PM W. Europe Standard Time, > jc...@di... writes: > >> I dont yet grok this filtering, ( I havent tried yet - so thats >> understandable), >> but its potentially related to the AutoCategorization feature I sent >> earlier. > > > > I don't see the connection -- how are they related? Also, regarding > performance, please note that this filter function usually isn't > called at all (see documentation in Log::Log4perl::Appender). Ill admit, the connection is tenous, but.. I took filtering as more flexible suppression of selected messages, which was one of my goals in wrapping Log4perl. > >> >> If you recall, my patch wrapped Log4perl with another class. >> that class handled all logging requests via AUTOLOAD; > > > > > Yeah, I recall, however I didn't quite follow your explanation of how > to make the severe runtime penalty go away via optimizer.pm. However, > I'm still interested, so if you've got some working code I can play > with, I'll be happy to take a look. Also, please note that log/nolog > decisions might very well change during runtime (config_and_watch for > example). I would use optimizer.pm to change $logger->debug (@args) to $logger->debug_uniq_100 (@args) everywhere it occurrs (with different unique number) thus when AUTOLOAD is called ( its a virtual function), it creates the method with the unique name. thus all other invokes get their own copy of the method (suitably customized to eliminate recurrent work). So AUTOLOAD is only called once per invoker, thereafter much more direct. code (which produced earlier output) is attached. Note that it has NO LOG4PERL functionality, which is why I didnt send it b4, I send it now so you can run it. Hopefully the POD will explain it more fully than above. btw - optimizer.pm probably requires 5.8, which may be another problem for use in Log::Log4perl config_and_watch is cool - I shoulda seen it at the top of the POD (and known it was useful enough to be there). Its not a show-stopper : by caching the newly minted methods , I can clear them out of the Symbol Table when a refresh is needed. Thereafter, the method wont exist, and AUTOLOAD will remake it. > > --- Mike > > Mike Schilli > log...@pe... > http://log4perl.sourceforge.net > http://perlmeister.com |