NAME
Ambrosia::Logger - a class for create global object for logging.
VERSION
version 0.010
SYNOPSIS
use Ambrosia::Logger;
BEGIN {
instance Ambrosia::Logger('myApplication', DEBUG => 1, INFO_EX => 1, INFO => 1, -prefix => 'GoogleCoupon_', -dir => $logger_path);
Ambrosia::Logger::assign 'myApplication';
}
logger->log('is just message', 'other message' );
logger->log_info('is simple info', ... );
logger->log_info_ex('is dump of structures info', {foo=>1}, [{bar=>1},{baz=>2}] );
logger->error('message about errors');
logger->debug('write with the message and the stack of calls');
DESCRIPTION
Ambrosia::Logger
is a class for create global object for logging. Implement the pattern Singleton.
instance
Instances the named object of type Ambrosia::Logger
in the pool. This method not exported. Use as constructor: instance Ambrosia::Logger(.....)
logger
Returns the global object of type Ambrosia::Logger
. logger(name)
- the name is optional param. Call with name if you not assign current process to logger yet.
assign
Assigns current process to the global named object of type Ambrosia::Logger
.
DEPENDENCIES
File::Path IO::File Data::Dumper Time::HiRes Scalar::Util Exporter Ambrosia::error::Exceptions
THREADS
Not tested.
BUGS
Please report bugs relevant to Ambrosia
to <knm[at]cpan.org>.
COPYRIGHT AND LICENSE
Copyright (C) 2010-2012 Nickolay Kuritsyn. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
Nikolay Kuritsyn (knm[at]cpan.org)