Agent/Priorities.pm

filter: Statementstmt 100% 44 / 44 Branchbran 75.0% 6 / 8 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 2 totaltotal 89.0% 57 / 64 CC 8 SCAR 9.9
CC
8
Cov
94%
level_from_prio
4.3
prio_from_level
3.0
priority_level
3.0
CRAP 2.7
« Agent/Driver/Syslog.pm ↑ Summary Agent/Driver.pm »
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 16 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 ########################################################################
17 package Log::Agent::Priorities;
18  
19 11 require Exporter;
20 16 ▶use AutoLoader 'AUTOLOAD';
Subroutine BEGIN: called CC=1 SCAR=0.0
21 16 ▶use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS @LEVELS);
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: not called CC=1 SCAR=0.0
22 11 @ISA = qw(Exporter);
23  
24 11 @LEVELS = qw(NONE EMERG ALERT CRIT ERROR WARN NOTICE INFO DEBUG);
25  
26 11 @EXPORT = qw(priority_level);
27 11 @EXPORT_OK = qw(prio_from_level level_from_prio);
28 11 push(@EXPORT_OK, @LEVELS);
29  
30 11 %EXPORT_TAGS = (LEVELS => \@LEVELS);
31  
32 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 16 ▶use vars qw(@basic_prio %basic_level);
Subroutine BEGIN: called CC=1 SCAR=0.0
45  
46 11 @basic_prio = qw(
47 emergency
48 alert
49 critical
50 error
51 warning warning
52 notice notice
53 info info);
54  
55 11 %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 11 1;
67 __END__
« Agent/Driver/Syslog.pm ↑ Summary Agent/Driver.pm »