The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Catalyst::Plugin::Log::Colorful - Catalyst Plugin for Colorful Log

SYNOPSYS

 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 );

DESCRIPTION

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 'oraora'.

METHOD

color

 $c->log->color($var, 'text color' , 'background color');

this color method wrap up log->debug() . text color and background color is optional.

setup

SEE ALSO

Catalyst::Log Term::ANSIColor

AUTHOR

Tomohiro Teranishi <tomohiro.teranishi@gmail.com>