Log::Dispatch

Dispatches messages to one or more outputs
Download

Log::Dispatch Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Dave Rolsky
  • Publisher web site:
  • http://search.cpan.org/~drolsky/

Log::Dispatch Tags


Log::Dispatch Description

Log::Dispatch is a Perl module that manages a set of Log::Dispatch::* output objects that can be logged to via a unified interface.The idea is that you create a Log::Dispatch object and then add various logging objects to it (such as a file logger or screen logger). Then you call the log method of the dispatch object, which passes the message to each of the objects, which in turn decide whether or not to accept the message and what to do with it.This makes it possible to call single method and send a message to a log file, via email, to the screen, and anywhere else, all with very little code needed on your part, once the dispatching object has been created.SYNOPSIS use Log::Dispatch; # Simple API # my $log = Log::Dispatch->new( outputs => , , ], ); $log->info('Blah, blah'); # More verbose API # my $log = Log::Dispatch->new(); $log->add( Log::Dispatch::File->new( name => 'file1', min_level => 'debug', filename => 'logfile' ) ); $log->add( Log::Dispatch::Screen->new( name => 'screen', min_level => 'warning', ) ); $log->log( level => 'info', message => 'Blah, blah' ); my $sub = sub { my %p = @_; return reverse $p{message}; }; my $reversing_dispatcher = Log::Dispatch->new( callbacks => $sub );Product's homepage


Log::Dispatch Related Software