Log::Minimal::Object - Provides the OOP interface of Log::Minimal
use Log::Minimal::Object; my $logger = Log::Minimal::Object->new(); $logger->infof("This is info!"); # => 2014-05-18T17:24:02 [INFO] This is info! at eg/sample.pl line 13 $logger->warnf("This is warn!"); # => 2014-05-18T17:24:02 [WARN] This is warn! at eg/sample.pl line 14
Log::Minimal::Object is the simple wrapper to provide the OOP interface of Log::Minimal.
This module can have and apply independent customize settings for each instance, it's intuitive!
Log::Minimal::Object->new(%arg | \%arg)
Creates the instance. This method receives arguments to configure as hash or hashref, like so;
my $logger = Log::Minimal::Object->new( color => 1, log_level => 'WARN', );
Please refer to the "CONFIGURATIONS" to know details of configurable items.
Instance of this module provides the methods that are defined in the "EXPORT FUNCTIONS" in Log::Minimal (e.g. infof, warnf, and etc).
The configurable keys and its relations are follows (please see also "CUSTOMIZE" in Log::Minimal to get information of $Log::Minimal::*):
$Log::Minimal::*
color
$Log::Minimal::COLOR (default: 0)
$Log::Minimal::COLOR
autodump
$Log::Minimal::AUTODUMP (default: 0)
$Log::Minimal::AUTODUMP
trace_level
$Log::Minimal::TRACE_LEVEL (default: 2, this value is equal to Log::Minimal::Object::DEFAULT_TRACE_LEVEL)
$Log::Minimal::TRACE_LEVEL
Log::Minimal::Object::DEFAULT_TRACE_LEVEL
log_level
$Log::Minimal::LOG_LEVEL (default: 'DEBUG')
$Log::Minimal::LOG_LEVEL
escape_whitespace
$Log::Minimal::ESCAPE_WHITESPACE (default: 0)
$Log::Minimal::ESCAPE_WHITESPACE
print
$Log::Minimal::PRINT
die
$Log::Minimal::DIE
Default trace_level of this module. When you would like to control the trace level on the basis of this module, please use this value.
For example: $logger->{trace_level} = Log::Minimal::Object::DEFAULT_TRACE_LEVEL + 1
$logger->{trace_level} = Log::Minimal::Object::DEFAULT_TRACE_LEVEL + 1
Log::Minimal
Copyright (C) moznion.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
moznion <moznion@gmail.com>
To install Log::Minimal::Object, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Log::Minimal::Object
CPAN shell
perl -MCPAN -e shell install Log::Minimal::Object
For more information on module installation, please visit the detailed CPAN module installation guide.