BusyBird::Log - simple logging infrastructure for BusyBird
use BusyBird::Log qw(bblog); bblog('error', 'Something bad happens'); { my @logs = (); ## Temporarily change the Logger local $BusyBird::Log::Logger = sub { my ($level, $msg) = @_; push(@logs, [$level, $msg]); }; bblog('info', 'This goes to @logs array.'); }
BusyBird::Log manages the logger singleton used in BusyBird.
This module is used by some of the BusyBird component modules to log warning/error messages.
The following functions are exported only by request.
Logs the given message.
$level is a string of log level such as 'info', 'warn', 'error', 'critical' etc. $msg is the log message body.
$level
$msg
By default, it prints the log to STDERR.
A subroutine reference that is called when bblog() is called. The subroutine is supposed to do the logging.
bblog()
Setting this to undef disables logging at all.
undef
Toshio Ito <toshioito [at] cpan.org>
<toshioito [at] cpan.org>
To install BusyBird, copy and paste the appropriate command in to your terminal.
cpanm
cpanm BusyBird
CPAN shell
perl -MCPAN -e shell install BusyBird
For more information on module installation, please visit the detailed CPAN module installation guide.