Guide Home
POD Home



A version of Sloop::Logger which uses ANSI escapes to color the output. This is probably not desirable if you are logging to a file since the escape sequences add clutter if viewed with that does not process them as ANSI. Output to a normal linux terminal though is of course fine.

Three colors are used, one for each element of the 'logs' array (see Sloop::Logger).

The colors aren't applied to the timestamp.


This refers only to things not part of Sloop or the perl core.



 my $logger = Sloop::Logger::ANSIcolor->new (
     logs => (optional), see Sloop::Logger

$colors is a array reference with three elements. These are passed through to Term::ANSIColor. For example:

 [ 'red', 'green, 'blue' ]

These parallel the 'logs' array. The color specification is as per Term::ANSIColor, including the use of `bold`, `on_` (for foreground/background combinations) and `grey` and `rgb` specs for 256 color terminals.