NAME

XLog::Logger - Base class for pure-perl logging backends

SYNPOSIS

package MyLogger;
use parent 'XLog::Logger';

sub new {
    my ($class, ...) = @_;
    my $self = $class->SUPER::new();
    ...
    return $self;
}

sub log {
    my ($self, $msg) = @_;
    say $msg;
}

DESCRIPTION

This is a base class for making pure-perl logging objects.

You need to define log method and do logging work there.

METHODS

new()

Create backend object.

Keep in mind that if you override new method you MUST create object by calling SUPER, not blessing new object by yourself, because there will be a C++ proxy object attached to perl object.

log($msg, $level)

You must override this method and do the logging work. $msg is a final formatted by formatter message. $level is log level for information purpose.