-
-
22 Jun 2022 12:36:10 UTC
- Distribution: XLog
- Source (raw)
- Pod Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues
- Testers (40 / 0 / 0)
- Kwalitee
Bus factor: 1- License: unknown
- Activity
24 month- Tools
- Download (22.81KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Export::XS
- XS::Framework
- XS::Install
- XS::libpanda
- next::XS
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
XLog::Formatter - Base class for pure-perl formatter backends
SYNPOSIS
package MyFormatter; use parent 'XLog::Formatter'; sub new { my ($class, ...) = @_; my $self = $class->SUPER::new(); ... return $self; } sub format { my ($self, $msg, $level, $module_name, $file, $line, $func) = @_; return "[".time()."] $msg at $file:$line"; }
DESCRIPTION
This is a base class for making pure-perl formatter object. API is very simple - you need to override a single subroutine
format
and return formatted string.METHODS
new()
Create backend object.
Keep in mind that if you override
new
method you MUST create object by callingSUPER
, not blessing new object by yourself, because there will be a C++ proxy object attached to perl object.format($msg, $level, $module_name, $file, $line, $func)
You must override this method and return resulting formatted log message.
The parameters are:
- $msg
-
Log message as it was passed by user
- $level
-
Log level (one of the constants)
- $module_name
-
Log module name
- $file
-
Filename with path where loging code is written
- $line
-
Line in file where loging code is written
- $func
-
Function or subroutine name where loging code is written
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 47:
=over without closing =back
- Around line 73:
=over is the last thing in the document?!
Module Install Instructions
To install XLog, copy and paste the appropriate command in to your terminal.
cpanm XLog
perl -MCPAN -e shell install XLog
For more information on module installation, please visit the detailed CPAN module installation guide.