Wrapper for the awesome Log::Log4perl
$ENV{POOTLE_CLIENT_VERBOSITY} = 'DEBUG'; #Set the log verbosity using Log::Log4perl log levels use Pootle::Logger; my $l = bless({}, 'Pootle::Logger'); #Lazy load package logger this way to avoid circular dependency issues with logger includes from many packages sub faraway { $l->debug("Debugging params: "$l->flatten(@_)) if $l->is_debug(); }
$l->isa('Log::Log4perl') logger. Have fun!
There is a bug in Log4perl, where loading use Log::Log4perl qw(:easy); to namespace in this file causes Deep recursion on subroutine "Log::Log4perl::get_logger" at /usr/share/perl5/Log/Log4perl.pm line 339, <FH> line 92.
Work around by not importing log levels, and manually duplicating them here. see /usr/share/perl5/Log/Log4perl/Level.pm for level integers
my $string = $logger->flatten(@_);
Given a bunch of $@%, the subroutine flattens those objects to a single human-readable string.
@PARAMS Anything, concatenates parameters to one flat string @RETURNS String, params flattened
To install Pootle::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pootle::Client
CPAN shell
perl -MCPAN -e shell install Pootle::Client
For more information on module installation, please visit the detailed CPAN module installation guide.