Log::Basic - Perl extension for simple logging.
perl -MLog::Basic -e 'info "hey"' use Log::Basic; $Log::Basic::VERBOSITY=3; debug "stuff"; # won't be printed info "here is the info message"; # won't be printed warning "wow! beware!"; error "something terrible happend !"; msg "this message will be displayed whatever the verbosity level"; sep "a separator"; fatal "fatal error: $!";
Log::Basic displays formatted messages according to the defined verbosity level (default:4).
Log messages are formatted as: `[<level>] <date> - <message>`. Dates are formatted as: `YYYY-MM-DD hh:mm:ss`. Your message could be whatever you what.
Verbosity and associated levels are:
Setting verbosity to 3 will print `warn`, `info`, and `msg` only.
`fatal` is a special level, corresponding to perl's `die()`.
Separator is a special functions which display a line of 80 dashes, with your message eventually.
All messages will also be appended to a file. If a `./log/` folder exists, a `$$.$0.log` file is created within this folder, otherwise the `$$.$0.log` file is created in the current directory.
debug info warning error msg sep fatal
Kevin Gravouil, <k.gravouil@gmail.com>
Copyright (C) 2016 by Kevin Gravouil
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.20.2 or, at your option, any later version of Perl 5 you may have available.
To install Log::Basic, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Log::Basic
CPAN shell
perl -MCPAN -e shell install Log::Basic
For more information on module installation, please visit the detailed CPAN module installation guide.