From: Wiggins d'A. <wi...@da...> - 2003-01-11 01:23:31
|
Mike Schilli wrote: > We're currently evaluating the idea of passing in an options hash before > the real message comes: > > $logger->log({format => "dbi"}, $col1, $col2, $col3); > > and > > $logger->log({format => "dump"}, $some_ref); > > The advantage of the latter over something like > > $logger->log(Data::Dumper::Dump($some_ref)); > > is obviously the performance gain in case the message gets suppressed. > This seems like a great idea, similar to the way (sorry I have it on the brain right now) POE uses "Filters" that basically work as translators on either end of a pipe. You tell one end of the pipe what to expect as a filter when the data comes out, and on the other end you create a filter and run the output through it before sticking it in the pipe, similar to saving state, or "formatting". Just a couple of thoughts, having a look at the POE implementation might give further ideas on this. And since our app most likely will be using POE with Log4perl it would help me out too ;-), since POE filters do not depend on the rest of POE. http://danconia.org |