File: color

package info (click to toggle)
liblog-log4perl-perl 1.57-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,956 kB
  • sloc: perl: 6,405; makefile: 9
file content (26 lines) | stat: -rwxr-xr-x 768 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/perl
######################################################################
# color - Print messages colored by level
######################################################################
use strict;
use warnings;

my  $VERSION = "0.01";
our $CVSVERSION = '$Revision: 1.1 $';

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

for(1..3) {
    DEBUG "Debug Message";
    INFO  "Info Message";
    WARN  "Warn Message";
    ERROR "Error Message";
    FATAL "Fatal Message";
}