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

Download:
Log-Dispatch-2.21.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  6
Open  3
View Bugs
Report a bug
Module Version: 1.26   Source   Latest Release: Log-Dispatch-2.26

NAME ^

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

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
  }

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

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

DESCRIPTION ^

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

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.

AUTHOR ^

Dave Rolsky, <autarch@urth.org>