Log4perl/Filter/LevelRange.pm

filter: Statementstmt 100% 34 / 34 Branchbran 100% 2 / 2 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 10 / 10 Podpod 0.0% 0 / 2 totaltotal 96.2% 51 / 53 CC 3 SCAR 4.1
CC
3
Cov
100%
ok
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.5
« Log4perl/Filter.pm ↑ Summary Log4perl/Layout/SimpleLayout.pm »
1 ##################################################
2 package Log::Log4perl::Filter::LevelRange;
3 ##################################################
4  
5 1 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use Log::Log4perl::Level;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Log::Log4perl::Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use Log::Log4perl::Util qw( params_check );
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1 ▶use constant _INTERNAL_DEBUG => 0;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 1 ▶use base "Log::Log4perl::Filter";
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 ##################################################
19 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
20 ##################################################
21 2 my ($class, %options) = @_;
22  
23 2 my $self = { LevelMin => 'DEBUG',
24 LevelMax => 'FATAL',
25 AcceptOnMatch => 1,
26 %options,
27 };
28
29 2 params_check( $self,
30 [ qw( LevelMin LevelMax ) ],
31 [ qw( name AcceptOnMatch ) ]
32 );
33  
34 $self->{AcceptOnMatch} = Log::Log4perl::Config::boolean_to_perlish(
35 2 $self->{AcceptOnMatch});
36  
37 2 bless $self, $class;
38  
39 2 return $self;
40 }
41  
42 ##################################################
43 8 ▶sub ok {
Subroutine ok: called CC=3 SCAR=11.0
Pod undocumented
44 ##################################################
45 8 my ($self, %p) = @_;
46  
47 8 ▶ if(Log::Log4perl::Level::to_priority($self->{LevelMin}) <=
Branch: 1 branch
BranchTrueFalseTotal
if (Log::Log4perl::Level::to_priority($self->{'LevelMin'}) <= Log::Log4perl::Level::to_priority($p{'log4p_level'}) and Log::Log4perl::Level::to_priority($self->{'LevelMax'}) >= Log::Log4perl::Level::to_priority($p{'log4p_level'})) { } 4 4 8
Condition100%3/3
Log::Log4perl::Level::to_priority($self->{"LevelMin"}) <= Log::Log4perl::Level::to_priority($p{"log4p_level"}) and Log::Log4perl::Level::to_priority($self->{"LevelMax"}) >= Log::Log4perl::Level::to_priority($p{"log4p_level"})
!ll&&!rl&&r
224
MC/DC100%2/2
Log::Log4perl::Level::to_priority($self->{"LevelMin"}) <= Log::Log4perl::Level::to_priority($p{"log4p_level"}) and Log::Log4perl::Level::to_priority($self->{"LevelMax"}) >= Log::Log4perl::Level::to_priority($p{"log4p_level"})
Log::Log4perl::Level::to_priority($self->{"LevelMin"}) <= Log::Log4perl::Level::to_priority($p{"log4p_level"}) Log::Log4perl::Level::to_priority($self->{"LevelMax"}) >= Log::Log4perl::Level::to_priority($p{"log4p_level"})
Truth table100%3/3
A and B
A= Log::Log4perl::Level::to_priority($self->{"LevelMin"}) <= Log::Log4perl::Level::to_priority($p{"log4p_level"})B= Log::Log4perl::Level::to_priority($self->{"LevelMax"}) >= Log::Log4perl::Level::to_priority($p{"log4p_level"})
ABresult
0X0
100
111
48 Log::Log4perl::Level::to_priority($p{log4p_level}) and
49 Log::Log4perl::Level::to_priority($self->{LevelMax}) >=
50 Log::Log4perl::Level::to_priority($p{log4p_level})) {
51 4 return $self->{AcceptOnMatch};
52 } else {
53 4 return ! $self->{AcceptOnMatch};
54 }
55 }
56  
57 1 1;
58  
59 __END__
« Log4perl/Filter.pm ↑ Summary Log4perl/Layout/SimpleLayout.pm »