baphomet has asked for the wisdom of the Perl Monks concerning the following question:
My classes are, say, Foo::Foo, Foo::Bar, and Foo::Baz. There's no "master class" and the Foo::* classes don't inherit from one another.
I can think of a few ways of doing this: I can create a package--say, Foo--which exports a package global $LOG that contains the Log::Common object. The Foo::* classes would need only "use Foo" to gain access to $LOG.
Or, I could create a wrapper class for Log::Common, then instantiate and export a single Foo::Log object to each Foo::* class... though, under the circumstances, it seems redundant.
Is there anything I'm missing? Glossing over? How would you share a single log file across multiple classes?
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sharing a log file across classes...
by dragonchild (Archbishop) on Feb 27, 2002 at 19:57 UTC | |
by Anonymous Monk on Feb 27, 2002 at 21:00 UTC | |
by dragonchild (Archbishop) on Feb 27, 2002 at 21:04 UTC | |
by Anonymous Monk on Feb 27, 2002 at 22:51 UTC | |
|
Re: Sharing a log file across classes...
by Matts (Deacon) on Feb 27, 2002 at 21:28 UTC | |
|
Re: Sharing a log file across classes...
by rbc (Curate) on Feb 27, 2002 at 23:07 UTC |