SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG
DONATE


YUM REPOSITORY

 
 

MAN page from RedHat EL 8 perl-Log-Log4perl-1.50-1.el8.noarch.rpm

Appender::ScreenColoredLevels

Section: User Contributed Perl Documentation (3)
Updated: 2020-07-22
Index 

NAME

Log::Log4perl::Appender::ScreenColoredLevel - Colorize messages according to level 

SYNOPSIS

    use Log::Log4perl qw(:easy);    Log::Log4perl->init(\ <<'EOT');      log4perl.category = DEBUG, Screen      log4perl.appender.Screen = \          Log::Log4perl::Appender::ScreenColoredLevels      log4perl.appender.Screen.layout = \          Log::Log4perl::Layout::PatternLayout      log4perl.appender.Screen.layout.ConversionPattern = \          %d %F{1} %L> %m %n    EOT      # Appears black    DEBUG "Debug Message";      # Appears green    INFO  "Info Message";      # Appears blue    WARN  "Warn Message";      # Appears magenta    ERROR "Error Message";      # Appears red    FATAL "Fatal Message";
 

DESCRIPTION

This appender acts like Log::Log4perl::Appender::Screen, except thatit colorizes its output, based on the priority of the message sent.

You can configure the colors and attributes used for the differentlevels, by specifying them in your configuration:

    log4perl.appender.Screen.color.TRACE=cyan    log4perl.appender.Screen.color.DEBUG=bold blue

You can also specify nothing, to indicate that level should not havecoloring applied, which means the text will be whatever the defaultcolor for your terminal is. This is the default for debug messages.

    log4perl.appender.Screen.color.DEBUG=

You can use any attribute supported by Term::ANSIColor as a configurationoption.

    log4perl.appender.Screen.color.FATAL=\        bold underline blink red on_white

The commonly used colors and attributes are:

attributes
BOLD, DARK, UNDERLINE, UNDERSCORE, BLINK
colors
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE
background colors
ON_BLACK, ON_RED, ON_GREEN, ON_YELLOW, ON_BLUE, ON_MAGENTA, ON_CYAN, ON_WHITE

See Term::ANSIColor for a complete list, and information on which aresupported by various common terminal emulators.

The default values for these options are:

Trace
Yellow
Debug
None (whatever the terminal default is)
Info
Green
Warn
Blue
Error
Magenta
Fatal
Red

The constructor "new()" takes an optional parameter "stderr",if set to a true value, the appender will log to STDERR. If "stderr"is set to a false value, it will log to STDOUT. The default settingfor "stderr" is 1, so messages will be logged to STDERR by default.The constructor can also take an optional parameter "color", whosevalue is a hashref of color configuration options, any levels thatare not included in the hashref will be set to their default values. 

Using ScreenColoredLevels on Windows

Note that if you're using this appender on Windows, you need to fetchWin32::Console::ANSI from CPAN and add

    use Win32::Console::ANSI;

to your script. 

LICENSE

Copyright 2002-2013 by Mike Schilli <m@perlmeister.com> and Kevin Goess <cpanAATTgoess.org>.

This library is free software; you can redistribute it and/or modifyit under the same terms as Perl itself. 

AUTHOR

Please contribute patches to the project on Github:

    http://github.com/mschilli/log4perl

Send bug reports or requests for enhancements to the authors via our

MAILING LIST (questions, bug reports, suggestions/patches): log4perl-develAATTlists.sourceforge.net

Authors (please contact them via the list above, not directly):Mike Schilli <m@perlmeister.com>,Kevin Goess <cpanAATTgoess.org>

Contributors (in alphabetical order):Ateeq Altaf, Cory Bennett, Jens Berthold, Jeremy Bopp, HuttonDavidson, Chris R. Donnelly, Matisse Enzer, Hugh Esco, AnthonyFoiani, James FitzGibbon, Carl Franks, Dennis Gregorovic, AndyGrundman, Paul Harrington, Alexander Hartmaier David Hull, Robert Jacobson, Jason Kohles, Jeff Macdonald, Markus Peter, Brett Rann, Peter Rabbitson, Erik Selberg, Aaron Straup Cope, Lars Thegler, David Viner, Mac Yang.


 

Index

NAME
SYNOPSIS
DESCRIPTION
Using ScreenColoredLevels on Windows
LICENSE
AUTHOR

This document was created byman2html,using the manual pages.