Dave Rolsky > Log-Dispatch > Log::Dispatch::Output

Download:
Log-Dispatch-2.26.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  6
Open  3
View Bugs
Report a bug
Module Version: 2.26   Source  

NAME ^

Log::Dispatch::Output - Base class for all Log::Dispatch::* objects

SYNOPSIS ^

  package Log::Dispatch::MySubclass;

  use Log::Dispatch::Output;
  use base qw( Log::Dispatch::Output );

  sub new
  {
      my $proto = shift;
      my $class = ref $proto || $proto;

      my %p = @_;

      my $self = bless {}, $class;

      $self->_basic_init(%p);

      # Do more if you like

      return $self;
  }

  sub log_message
  {
      my $self = shift;
      my %p = @_;

      # Do something with message in $p{message}
  }

  1;

DESCRIPTION ^

This module is the base class from which all Log::Dispatch::* objects should be derived.

CONSTRUCTOR ^

The constructor, new, must be overridden in a subclass. See Output Classes for a description of the common parameters accepted by this constructor.

METHODS ^

Subclassing

This class should be used as the base class for all logging objects you create that you would like to work under the Log::Dispatch architecture. Subclassing is fairly trivial. For most subclasses, if you simply copy the code in the SYNOPSIS and then put some functionality into the log_message method then you should be all set. Please make sure to use the _basic_init method as directed.

The actual logging implementation should be done in a log_message method that you write. Do not override log!.

AUTHOR ^

Dave Rolsky, <autarch@urth.org>