Crane::Logger - Log manager
use Crane::Logger; log_fatal('Fatal message', caller); log_error('Error message'); log_warning('Warning message', $ref); log_info("First line\nSecond line\n"); log_debug($ref); log_verbose('First line', 'Second line');
Simple log manager with six log levels. Supports auto split messages by "end of line" and dump references using Data::Dumper.
Each log entry looks like ...
[2013-12-30 02:36:22 +0400 1388356582] Hello, world!
... and contains:
Date in ISO format: YYYY-MM-DD.
2013-12-30
Time in ISO format: hh:mm:ss.
02:36:22
Time zone in ISO format: ±hhmm.
+0400
Unix time.
1388356582
Log message.
Hello, world!
In case of log reference, each line will contain "header" (date and times):
[2013-12-30 02:36:22 +0400 1388356582] { [2013-12-30 02:36:22 +0400 1388356582] 'room' => 'Sitting room', [2013-12-30 02:36:22 +0400 1388356582] 'colors' => [ [2013-12-30 02:36:22 +0400 1388356582] 'orange', [2013-12-30 02:36:22 +0400 1388356582] 'purple', [2013-12-30 02:36:22 +0400 1388356582] 'black' [2013-12-30 02:36:22 +0400 1388356582] ] [2013-12-30 02:36:22 +0400 1388356582] }
Logs messages at a FATAL level only.
Logs messages classified as ERROR and FATAL.
Logs messages classified as WARNING, ERROR and FATAL.
Logs messages classified as INFO, WARNING, ERROR and FATAL.
Logs messages classified as DEBUG, INFO, WARNING, ERROR and FATAL.
Logs messages classified as VERBOSE, DEBUG, INFO, WARNING, ERROR and FATAL.
Messages on levels: FATAL, ERROR and WARNING go to error log; INFO, DEBUG and VERBOSE go to messages log.
Logs @messages with level FATAL.
Logs @messages with level ERROR.
Logs @messages with level WARNING.
Logs @messages with level INFO.
Logs @messages with level DEBUG.
Logs @messages with level VERBOSE.
Write @messages to file handle $fh.
Where %s is log filename and %s is reason message.
Fires when unable to open or write to log file.
Fires when call write_to_fh with invalid file handle.
Default log file with messages.
Default log file with errors.
Please report any bugs or feature requests to https://rt.cpan.org/Public/Bug/Report.html?Queue=Crane or to https://github.com/temoon/crane/issues.
Tema Novikov, <novikov.tema@gmail.com>
Copyright (C) 2013-2014 Tema Novikov.
This library is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0. For details, see the full text of the license in the file LICENSE.
RT Cpan
https://rt.cpan.org/Public/Dist/Display.html?Name=Crane
Github
https://github.com/temoon/crane
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in '±hhmm.'. Assuming UTF-8
To install Crane, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Crane
CPAN shell
perl -MCPAN -e shell install Crane
For more information on module installation, please visit the detailed CPAN module installation guide.