Dancer::Logger::ColorConsole - colored console-based logging engine for Dancer
This is a colored console-based logging engine that prints your logs to the console.
First, set the logger. Probably in your environment/development.yml file:
environment/development.yml
logger: colorConsole
Then, you can configure colors for the four debug levels:
engines: logger: levels: core: 'red' warning: 'white on_yellow' debug: 'clear' error: 'bold white on_red'
Check the colors/types supported in the Term::ANSIColor manual.
You can define regular expressions (and colors to be used) with:
engines: logger: regexps: - re: 'trying to match .*' color: 'green' - re: 'request: .*' color: 'bold'
By default, Dancer::Logger::ColorConsole makes some specific regular expressions colored. For instance, response: 200 are colored in green, while response: 404 are colored in red.
Dancer::Logger::ColorConsole
response: 200
response: 404
At the moment you can turn off these built-in regexps with:
engines: logger: default_regexps: 0
Alberto Simões
Copyright 2011 Alberto Simões
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Dancer::Logger::ColorConsole, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer::Logger::ColorConsole
CPAN shell
perl -MCPAN -e shell install Dancer::Logger::ColorConsole
For more information on module installation, please visit the detailed CPAN module installation guide.