File Coverage

blib/lib/Log/Agent/Priorities.pm
Criterion Covered Total %
statement 21 22 95.4
branch 6 8 75.0
condition 1 2 50.0
subroutine 6 7 85.7
pod 0 2 0.0
total 34 41 82.9


line stmt bran cond sub pod time code
1             ###########################################################################
2             #
3             # Priorities.pm
4             #
5             # Copyright (C) 1999 Raphael Manfredi.
6             # Copyright (C) 2002-2017 Mark Rogaski, mrogaski@cpan.org;
7             # all rights reserved.
8             #
9             # See the README file included with the
10             # distribution for license information.
11             #
12             ##########################################################################
13              
14 14     14   98 use strict;
  14         28  
  14         666  
15              
16             ########################################################################
17             package Log::Agent::Priorities;
18              
19             require Exporter;
20 14     14   74 use AutoLoader 'AUTOLOAD';
  14         62  
  14         73  
21 14     14   566 use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS @LEVELS);
  14     0   29  
  14         4014  
22             @ISA = qw(Exporter);
23              
24             @LEVELS = qw(NONE EMERG ALERT CRIT ERROR WARN NOTICE INFO DEBUG);
25              
26             @EXPORT = qw(priority_level);
27             @EXPORT_OK = qw(prio_from_level level_from_prio);
28             push(@EXPORT_OK, @LEVELS);
29              
30             %EXPORT_TAGS = (LEVELS => \@LEVELS);
31              
32 0         0 BEGIN {
33             sub NONE () {-1}
34             sub EMERG () {0}
35             sub ALERT () {1}
36             sub CRIT () {2}
37             sub ERROR () {3}
38             sub WARN () {4}
39             sub NOTICE () {6}
40             sub INFO () {8}
41             sub DEBUG () {10}
42             }
43              
44 14     14   110 use vars qw(@basic_prio %basic_level);
  14         41  
  14         1865  
45              
46             @basic_prio = qw(
47             emergency
48             alert
49             critical
50             error
51             warning warning
52             notice notice
53             info info);
54              
55             %basic_level = (
56             'em' => EMERG, # emergency
57             'al' => ALERT, # alert
58             'cr' => CRIT, # critical
59             'er' => ERROR, # error
60             'wa' => WARN, # warning
61             'no' => NOTICE, # notice
62             'in' => INFO, # info
63             'de' => DEBUG, # debug
64             );
65              
66             1;
67             __END__