Catalyst::Plugin::Log::Colorful - Catalyst Plugin for Colorful Log
use Catalyst qw/-Debug ConfigLoader Log::Colorful/; __PACKAGE__->config( name => 'MyApp' , 'Plugin::Log::Colorful' => { text => 'blue', background => 'green', } );
In your controller.
$c->log->color('hello'); $c->log->color('hello blue' , 'blue'); $c->log->color('hello red on white' , 'red' , 'white'); $c->log->color( $hash_ref ); $c->log->color( $array_ref );
This plugin injects a color() method into the Catalyst::Log namespace.
Sometimes when I am monitoring 'tail -f error_log' or './script/my_server.pl' during develop phase , I could not find log message because of a lot of logs. This plugin may help to find it out. This plugin is using Term::ANSIColor .
Of course when you open log file with vi or some editor , the color wont change and also you will see additional log such as '[31;47moraora[0m'.
$c->log->color($var, 'text color' , 'background color');
this color method wrap up log->debug() . text color and background color is optional.
Catalyst::Log Term::ANSIColor
Tomohiro Teranishi <tomohiro.teranishi@gmail.com>
To install Catalyst::Plugin::Log::Colorful, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Plugin::Log::Colorful
CPAN shell
perl -MCPAN -e shell install Catalyst::Plugin::Log::Colorful
For more information on module installation, please visit the detailed CPAN module installation guide.