XLog::Logger - Base class for pure-perl logging backends
package MyLogger; use parent 'XLog::Logger'; sub new { my ($class, ...) = @_; my $self = $class->SUPER::new(); ... return $self; } sub log { my ($self, $msg) = @_; say $msg; }
This is a base class for making pure-perl logging objects.
You need to define log method and do logging work there.
log
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.
new
SUPER
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.
$msg
$level
To install XLog, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XLog
CPAN shell
perl -MCPAN -e shell install XLog
For more information on module installation, please visit the detailed CPAN module installation guide.