From: Erik W. S. <er...@se...> - 2002-09-24 05:32:29
|
Well, what I actually did in my code is something that looks a lot like this. :) I basically created a faux package that exports $logger into the current namespace. So yeah, it's basically a global variable. But sometimes, that's what you want. :) Anyway, I then just call $logger->whatever() whenever and whereever I want, and never really worry about it. Oh and I don't use categories, as mostly what I'm doing is outputting to a given file or syslog. Just me. If I'm good I'll rip out all the Real-specific things and post it. -e msc...@ao... wrote: >In a message dated Mon, 23 Sep 2002 11:05:31 PM Eastern Standard Time, mrd...@ya... writes: > > > >>A quick glance at the code, and me think one could cache >>the logger objects without trouble (unless they are much >>bigger than I think). So get_logger would become: >> >> > >Well, this is already done of course by the current implementation -- Log4perl uses a singleton mechanism. > >The overhead arises because of multiple get_logger() calls (which are admittedly quite cheap, but it adds up). > > > |