Log/Filter.pm

filter: Statementstmt 49.6% 75 / 151 Branchbran 24.1% 28 / 116 Conditioncond 22.8% 8 / 35 MC/DCmcdc 0.0% 0 / 20 Subroutinesub 62.5% 5 / 8 Podpod 0.0% 0 / 3 totaltotal 34.8% 116 / 333 CC 74 SCAR 52.7
CC
74
Cov
37%
BEGIN
419.7
space
90.0
pad
90.0
CRAP 195.2
« Log.pm ↑ Summary Log/Apache.pm »
1 package Easy::Log::Filter;
2 1 our $this_package;
3 1 our ($FILTER_REGEX, $NOT_FILTER_REGEX, $FILTER_ALL_REGEX, $MATCH_LOG_LEVEL_REGEX, $FILTER, $NOT_FILTER, $FILTER_CNT );
4 # if any $(.*)log->write(...)'s are in the calling code, and the log level is specified with one of the followin prepended with a '$'
5 1 ▶use constant DEFAULT_FILTER => (qw( mll lll cll qll ell all wll nll ill dll tll sll ), map { "dl$_" } ( 0 .. 9, 99 ));
Subroutine BEGIN: called CC=1 SCAR=0.0
6 28 ▶use constant LOG_LEVELS => ( map { $_ => "D_$_"; } qw( MESSAGE LOUD CLEAN QUIT EXIT
Subroutine BEGIN: called CC=1 SCAR=0.0
7 EMERG ALERT CRIT FATAL FAIL ERROR WARN NOTICE INFO DEBUG
8 1 TRACE SPEW ), map { "DEBUG$_"} ( 0 .. 9, 99 )
9 1 );
10  
11 1 ▶BEGIN {
Subroutine BEGIN: called CC=29 SCAR=60.4
12 0 ▶ sub space {
Subroutine space: not called CC=9 SCAR=45.0
Pod undocumented
13 0 my $sp = 'space';
14 # this is a stupid little subroutine to nicely display stuff
15 # could probably use a format specifier or sprintf better, but what the hell
16 # I mostly use this for aligning output nicely
17 0 my $piece = shift;
18 0 my $max = shift;
19 0 ▶ defined $max or $max = 27;
Branch: 1 branch
BranchTrueFalseTotal
defined $max or $max = 27 0 0 0
20 0 my $separator = shift;
21 0 ▶ unless( defined $separator and length $separator > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $separator and length $separator > 0) 0 0 0
Condition0%0/3
defined $separator and length $separator > 0
!ll&&!rl&&r
000
MC/DC0%0/2
defined $separator and length $separator > 0
defined $separator length $separator > 0
Truth table0%0/3
A and B
A= defined $separatorB= length $separator > 0
ABresult
0X0
100
111
22 0 $separator = ' ';
23 }
24 0 ▶ my $lp = defined $piece ? length $piece : 0;
Branch: 1 branch
BranchTrueFalseTotal
defined $piece ? : 0 0 0
25 0 my $ls = length $separator;
26 0 ▶ my $multiplier = $lp < $max ? int (( $max - $lp )/$ls ) : 0;
Branch: 1 branch
BranchTrueFalseTotal
$lp < $max ? : 0 0 0
27 0 my $spacer = $separator x $multiplier;
28 0 ▶ my $return = $sp eq 'space' ? $piece . $spacer : $spacer . $piece;
Branch: 1 branch
BranchTrueFalseTotal
$sp eq 'space' ? : 0 0 0
29 0 my $lr = length $return;
30 0 ▶ my $finisher = $lr < $max ? ( ' ' x ( $max - $lr )) : '';
Branch: 1 branch
BranchTrueFalseTotal
$lr < $max ? : 0 0 0
31 0 ▶ $return = $sp eq 'space' ? ( $return . $finisher ) : ( $finisher . $return );
Branch: 1 branch
BranchTrueFalseTotal
$sp eq 'space' ? : 0 0 0
32 0 return $return;
33
34 }
35 0 ▶ sub pad {
Subroutine pad: not called CC=9 SCAR=45.0
Pod undocumented
36 0 my $sp = 'pad';
37 # this is a stupid little subroutine to nicely display stuff
38 # could probably use a format specifier or sprintf better, but what the hell
39 # I mostly use this for aligning output nicely
40 0 my $piece = shift;
41 0 my $max = shift;
42 0 ▶ defined $max or $max = 27;
Branch: 1 branch
BranchTrueFalseTotal
defined $max or $max = 27 0 0 0
43 0 my $separator = shift;
44 0 ▶ unless( defined $separator and length $separator > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $separator and length $separator > 0) 0 0 0
Condition0%0/3
defined $separator and length $separator > 0
!ll&&!rl&&r
000
MC/DC0%0/2
defined $separator and length $separator > 0
defined $separator length $separator > 0
Truth table0%0/3
A and B
A= defined $separatorB= length $separator > 0
ABresult
0X0
100
111
45 0 $separator = ' ';
46 }
47 0 ▶ my $lp = defined $piece ? length $piece : 0;
Branch: 1 branch
BranchTrueFalseTotal
defined $piece ? : 0 0 0
48 0 my $ls = length $separator;
49 0 ▶ my $multiplier = $lp < $max ? int (( $max - $lp )/$ls ) : 0;
Branch: 1 branch
BranchTrueFalseTotal
$lp < $max ? : 0 0 0
50 0 my $spacer = $separator x $multiplier;
51 0 ▶ my $return = $sp eq 'space' ? $piece . $spacer : $spacer . $piece;
Branch: 1 branch
BranchTrueFalseTotal
$sp eq 'space' ? : 0 0 0
52 0 my $lr = length $return;
53 0 ▶ my $finisher = $lr < $max ? ( ' ' x ( $max - $lr )) : '';
Branch: 1 branch
BranchTrueFalseTotal
$lr < $max ? : 0 0 0
54 0 ▶ $return = $sp eq 'space' ? ( $return . $finisher ) : ( $finisher . $return );
Branch: 1 branch
BranchTrueFalseTotal
$sp eq 'space' ? : 0 0 0
55 0 return $return;
56
57 }
58 0 ▶ sub space_pad {
Subroutine space_pad: not called CC=9 SCAR=45.0
Pod undocumented
59 0 my $sp = pop;
60 # this is a stupid little subroutine to nicely display stuff
61 # could probably use a format specifier or sprintf better, but what the hell
62 # I mostly use this for aligning output nicely
63 0 my $piece = shift;
64 0 my $max = shift;
65 0 ▶ defined $max or $max = 27;
Branch: 1 branch
BranchTrueFalseTotal
defined $max or $max = 27 0 0 0
66 0 my $separator = shift;
67 0 ▶ unless( defined $separator and length $separator > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $separator and length $separator > 0) 0 0 0
Condition0%0/3
defined $separator and length $separator > 0
!ll&&!rl&&r
000
MC/DC0%0/2
defined $separator and length $separator > 0
defined $separator length $separator > 0
Truth table0%0/3
A and B
A= defined $separatorB= length $separator > 0
ABresult
0X0
100
111
68 0 $separator = ' ';
69 }
70 0 ▶ my $lp = defined $piece ? length $piece : 0;
Branch: 1 branch
BranchTrueFalseTotal
defined $piece ? : 0 0 0
71 0 my $ls = length $separator;
72 0 ▶ my $multiplier = $lp < $max ? int (( $max - $lp )/$ls ) : 0;
Branch: 1 branch
BranchTrueFalseTotal
$lp < $max ? : 0 0 0
73 0 my $spacer = $separator x $multiplier;
74 0 ▶ my $return = $sp eq 'space' ? $piece . $spacer : $spacer . $piece;
Branch: 1 branch
BranchTrueFalseTotal
$sp eq 'space' ? : 0 0 0
75 0 my $lr = length $return;
76 0 ▶ my $finisher = $lr < $max ? ( ' ' x ( $max - $lr )) : '';
Branch: 1 branch
BranchTrueFalseTotal
$lr < $max ? : 0 0 0
77 0 ▶ $return = $sp eq 'space' ? ( $return . $finisher ) : ( $finisher . $return );
Branch: 1 branch
BranchTrueFalseTotal
$sp eq 'space' ? : 0 0 0
78 0 return $return;
79
80 }
81
82 # sub space {
83 # space_pad( @_, 'space');
84 # }
85 # sub pad {
86 # space_pad( @_, 'pad');
87 # }
88  
89  
90
91 #die;
92 1 $this_package = __PACKAGE__;
93 1 ▶ $ENV{LOG_PACKAGES_DEBUG} ||= 0;
Condition50%1/2
$ENV{"LOG_PACKAGES_DEBUG"} ||= 0
l!l
01
MC/DC0%0/1
$ENV{"LOG_PACKAGES_DEBUG"} ||= 0
$ENV{"LOG_PACKAGES_DEBUG"}
Truth table50%1/2
A
A= $ENV{"LOG_PACKAGES_DEBUG"}
Aresult
11
00
94 1 ▶ $ENV{LOG_FILTER_DEBUG} = exists $ENV{LOG_FILTER_DEBUG} ? $ENV{LOG_FILTER_DEBUG} : 0;
Branch: 1 branch
BranchTrueFalseTotal
exists $ENV{'LOG_FILTER_DEBUG'} ? : 0 1 1
95 1 ▶ $ENV{LOG_FILTER_PACKAGES_DEBUG} = exists $ENV{LOG_FILTER_PACKAGES_DEBUG} ? $ENV{LOG_FILTER_PACKAGES_DEBUG} : 0; # want to make it so you can see what the filter is doing for specified packages only
Branch: 1 branch
BranchTrueFalseTotal
exists $ENV{'LOG_FILTER_PACKAGES_DEBUG'} ? : 0 1 1
96 1 ▶ $ENV{LOG_FILTER} ||= 'ON';
Condition50%1/2
$ENV{"LOG_FILTER"} ||= "ON"
l!l
01
MC/DC0%0/1
$ENV{"LOG_FILTER"} ||= "ON"
$ENV{"LOG_FILTER"}
Truth table50%1/2
A
A= $ENV{"LOG_FILTER"}
Aresult
11
00
97 1 ▶ $ENV{LOG_INTERNAL_DEBUG} ||= 0;
Condition50%1/2
$ENV{"LOG_INTERNAL_DEBUG"} ||= 0
l!l
01
MC/DC0%0/1
$ENV{"LOG_INTERNAL_DEBUG"} ||= 0
$ENV{"LOG_INTERNAL_DEBUG"}
Truth table50%1/2
A
A= $ENV{"LOG_INTERNAL_DEBUG"}
Aresult
11
00
98 1 ▶ print STDERR "THIS_PACKAGE=$this_package\n" if $ENV{LOG_FILTER_DEBUG};
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"LOG_FILTER_DEBUG"} 0 1 1
99 1 my @DEFAULT_FILTER= DEFAULT_FILTER();
100 1 ▶ unless ( defined $FILTER_REGEX ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $FILTER_REGEX) 1 0 1
101 1 my $FILTER;
102 1 ▶ if( $ENV{LOG_FILTER} =~ /^off$/i ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($ENV{'LOG_FILTER'} =~ /^off$/i) { } 0 1 1
elsif ($ENV{'LOG_FILTER'} =~ /^(on|\d+)$/i) { } 1 0 1
103 0 ▶ print STDERR __PACKAGE__, ":", __LINE__, ": ", "FILTER: IS OFF\n" if $ENV{LOG_FILTER_DEBUG};
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"LOG_FILTER_DEBUG"} 0 0 0
104 0 $FILTER = [];
105 0 $NOT_FILTER = [ @DEFAULT_FILTER ];
106 } elsif( $ENV{LOG_FILTER} =~ /^(on|\d+)$/i ) {
107 1 ▶ print STDERR __PACKAGE__, ":", __LINE__, ": ", "FILTER: IS ON\n" if $ENV{LOG_FILTER_DEBUG};
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"LOG_FILTER_DEBUG"} 0 1 1
108 1 $FILTER = [ @DEFAULT_FILTER ];
109 1 $NOT_FILTER = [];
110 } else {
111 0 ▶ print STDERR __PACKAGE__, ":", __LINE__, ": ", "FILTER: IS SPECIAL FILTER=$ENV{LOG_FILTER}\n" if $ENV{LOG_FILTER_DEBUG};
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"LOG_FILTER_DEBUG"} 0 0 0
112 0 my %not_filter = ();
113 0 my %filter = ();
114 0 foreach my $piece ( split( /:/, $ENV{LOG_FILTER} )) {
115 0 ▶ if ( $piece =~ /^\!/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($piece =~ /^\!/) { } 0 0 0
116 0 $piece =~ s/^\!//;
117 0 $not_filter{$piece} = $piece;
118 } else {
119 0 $filter{$piece} = $piece;
120 }
121 }
122 0 ▶ print STDERR __PACKAGE__, ":", __LINE__, ": ", "\%filter: ", scalar keys %filter , ":", join( ', ', keys %filter ), "\n" if $ENV{LOG_FILTER_DEBUG};
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"LOG_FILTER_DEBUG"} 0 0 0
123 0 ▶ print STDERR __PACKAGE__, ":", __LINE__, ": ", "\%not_filter: ", scalar keys %not_filter, ":", join( ', ', keys %not_filter ), "\n" if $ENV{LOG_FILTER_DEBUG};
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"LOG_FILTER_DEBUG"} 0 0 0
124 0 ▶ if ( scalar keys %filter ) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar keys %filter) { } 0 0 0
125 0 $FILTER = [ keys %filter ];
126 0 $NOT_FILTER = [];
127 } else {
128 # $FILTER = [ map { ($not_filter{$_} and $_ =~ /$not_filter{$_}/ )? () : $_; } ( @DEFAULT_FILTER ) ];
129 # $NOT_FILTER = [ map { ($not_filter{$_} and $_ =~ /$not_filter{$_}/ )? $_ : (); } ( @DEFAULT_FILTER ) ];
130 0 my $not_filter_rx = join('|', values %not_filter);
131 0 $not_filter_rx = qr/$not_filter_rx/;
132 0 ▶ print STDERR __PACKAGE__, ":", __LINE__, ": ", "not_filter_rx : '$not_filter_rx'\n" if $ENV{LOG_FILTER_DEBUG};
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"LOG_FILTER_DEBUG"} 0 0 0
133 0 ▶ $FILTER = [ map { $_ =~ m/$not_filter_rx/ ? () : $_; } ( @DEFAULT_FILTER ) ];
Branch: 1 branch
BranchTrueFalseTotal
$_ =~ /$not_filter_rx/ ? : 0 0 0
134 0 ▶ $NOT_FILTER = [ map { $_ =~ m/$not_filter_rx/ ? $_ : (); } ( @DEFAULT_FILTER ) ];
Branch: 1 branch
BranchTrueFalseTotal
$_ =~ /$not_filter_rx/ ? : 0 0 0
135 }
136 }
137 1 ▶ print STDERR __PACKAGE__, ":", __LINE__, ": ", "FILTER: ", join('|', @$FILTER ), "\n" if $ENV{LOG_FILTER_DEBUG};
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"LOG_FILTER_DEBUG"} 0 1 1
138 #$FILTER_REGEX = '\$[_a-zA-Z]*[_a-zA-Z0-9]*log->write\(.*?\$(' . join('|', @$FILTER) . '),.*?\);';
139 1 $FILTER_REGEX = '\$[_a-zA-Z]+[_a-zA-Z0-9]*->write\(.*?\$(' . join('|', @$FILTER) . '),.*?\);';
140 1 ▶ print STDERR __PACKAGE__, ":", __LINE__, ": ", "FILTER_REGEX : $FILTER_REGEX\n" if $ENV{LOG_FILTER_DEBUG};
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"LOG_FILTER_DEBUG"} 0 1 1
141 1 ▶ print STDERR __PACKAGE__, ":", __LINE__, ": ", "NOT_FILTER: ", join('|', @$NOT_FILTER ), "\n" if $ENV{LOG_FILTER_DEBUG};
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"LOG_FILTER_DEBUG"} 0 1 1
142 #$NOT_FILTER_REGEX = '\$[_a-zA-Z]*[_a-zA-Z0-9]*log->write\(.*?\$(' . join('|', @$NOT_FILTER) . ')(\,|\ \,|\,\ ).*?\);';
143 1 $NOT_FILTER_REGEX = '\$[_a-zA-Z]+[_a-zA-Z0-9]*->write\(.*?\$(' . join('|', @$NOT_FILTER) . ')(\,|\ \,|\,\ ).*?\);';
144 1 ▶ print STDERR __PACKAGE__, ":", __LINE__, ": ", "NOT_FILTER_REGEX : $NOT_FILTER_REGEX\n" if $ENV{LOG_FILTER_DEBUG};
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"LOG_FILTER_DEBUG"} 0 1 1
145 }
146  
147 1 ▶ unless ( defined $FILTER_ALL_REGEX ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $FILTER_ALL_REGEX) 1 0 1
148 1 my $FILTER = [ @DEFAULT_FILTER ];
149 # $FILTER_ALL_REGEX = '(\s+\$[_a-zA-Z]*[_a-zA-Z0-9]*log->write\(.*?)(' . join('|', @$FILTER) . ')(\,|\ \,|\,\ )(.*?\);)';
150 1 $FILTER_ALL_REGEX = '(\$[_a-zA-Z]*[_a-zA-Z0-9]*log->write\(.*?)(' . join('|', @$FILTER) . ')(\,|\ \,|\,\ )(.*?\);)';
151 1 ▶ print STDERR __PACKAGE__, ":", __LINE__, ": ", "FILTER_ALL_REGEX: $FILTER_ALL_REGEX\n" if $ENV{LOG_FILTER_DEBUG};
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"LOG_FILTER_DEBUG"} 0 1 1
152 }
153  
154 1 ▶ unless ( defined $MATCH_LOG_LEVEL_REGEX ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $MATCH_LOG_LEVEL_REGEX) 1 0 1
155 1 my $FILTER = [ LOG_LEVELS() ];
156 1 $MATCH_LOG_LEVEL_REGEX = '(\$[_a-zA-Z]*[_a-zA-Z0-9]*log->write\(.*?)(' . join('|', @$FILTER) . ')(\,|\ \,|\,\ )(.*?\);)';
157 1 ▶ print STDERR __PACKAGE__, ":", __LINE__, ": ", "MATCH_LOG_LEVEL_REGEX: $MATCH_LOG_LEVEL_REGEX\n" if $ENV{LOG_FILTER_DEBUG};
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"LOG_FILTER_DEBUG"} 0 1 1
158 }
159 }
160  
161 1 ▶use Filter::Simple;
Subroutine BEGIN: called CC=1 SCAR=0.0
162 1 our $replace = '1;';
163 1 ▶FILTER { # this filters out unwanted log messages from source code BEFORE COMPILATION
Subroutine __ANON__: called CC=22 SCAR=40.0
164 # proves to be a great boon to performance
165 1 $FILTER_CNT++;
166 ##print STDERR __LINE__, ": \$ENV{LOG_FILTER} = $ENV{LOG_FILTER}\n";
167 1 ▶ return if ( $ENV{LOG_FILTER} and $ENV{LOG_FILTER} =~ /^(OFF|)$/i);
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"LOG_FILTER"} and $ENV{"LOG_FILTER"} =~ /^(OFF|)$/i 0 1 1
Condition33%1/3
$ENV{"LOG_FILTER"} and $ENV{"LOG_FILTER"} =~ /^(OFF|)$/i
!ll&&!rl&&r
010
MC/DC0%0/2
$ENV{"LOG_FILTER"} and $ENV{"LOG_FILTER"} =~ /^(OFF|)$/i
$ENV{"LOG_FILTER"} $ENV{"LOG_FILTER"} =~ /^(OFF|)$/i
Truth table33%1/3
A and B
A= $ENV{"LOG_FILTER"}B= $ENV{"LOG_FILTER"} =~ /^(OFF|)$/i
ABresult
0X0
100
111
168 #return if ( $before =~ /\s*/s );
169 1 my @caller = caller(1);
170 1 ▶ $ENV{LOG_FILTER_DEBUG} ||= 0;
Condition50%1/2
$ENV{"LOG_FILTER_DEBUG"} ||= 0
l!l
01
MC/DC0%0/1
$ENV{"LOG_FILTER_DEBUG"} ||= 0
$ENV{"LOG_FILTER_DEBUG"}
Truth table50%1/2
A
A= $ENV{"LOG_FILTER_DEBUG"}
Aresult
11
00
171 0 ▶ print STDERR __PACKAGE__, ":", __LINE__, ": ", "CALLER: \n\t", join("\t\n", map { (defined $_ ? $_ : '')} @caller ), "\n" if ($ENV{LOG_FILTER_DEBUG} > 6);
Branch: 2 branches
BranchTrueFalseTotal
if $ENV{"LOG_FILTER_DEBUG"} > 6 0 1 1
defined $_ ? : 0 0 0
172 1 my $package = $caller[0];
173 1 my $file = $caller[1];
174 1 my $calline = $caller[2];
175 #print STDERR "." if $ENV{LOG_FILTER_DEBUG};
176 1 ▶ my $debug_this_package = $ENV{LOG_FILTER_PACKAGES_DEBUG} ? $file =~ /$ENV{LOG_FILTER_PACKAGES_DEBUG}/ : 1;
Branch: 1 branch
BranchTrueFalseTotal
$ENV{'LOG_FILTER_PACKAGES_DEBUG'} ? : 0 1 1
177 1 ▶ print STDERR __PACKAGE__, ":", __LINE__, ": ", "DEBUG_THIS_PACKAGE=$debug_this_package ... CALLED FROM FILE: '$file' ($ENV{LOG_FILTER_PACKAGES_DEBUG})\n" if $ENV{LOG_FILTER_DEBUG};
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"LOG_FILTER_DEBUG"} 0 1 1
178 1 ▶ my $not_filtered = $ENV{LOG_FILTER_DEBUG} ? "' ### LOG MESSAGE UN-FILTERABLE ### '" : '';
Branch: 1 branch
BranchTrueFalseTotal
$ENV{'LOG_FILTER_DEBUG'} ? : 0 1 1
179 1 my @match;
180 1 my @before = split("\n", $_ );
181 1 my @after = ();
182 1 my $linenum = $calline;
183 1 my $totallines = scalar @before;
184 1 my $filtered = '';
185 1 my $filtered_status = '';
186 1 foreach my $line ( @before ) {
187 1524 $linenum++;
188 1524 $filtered = '';
189 1524 $filtered_status = '';
190 1524 ▶ if ( $line =~ /$MATCH_LOG_LEVEL_REGEX/ ) {
Branch: 4 branches
BranchTrueFalseTotal
if ($line =~ /$MATCH_LOG_LEVEL_REGEX/) { } 5 1519 1524
elsif ($line =~ s/($FILTER_REGEX)\s*$/$replace/g) { } 10 1509 1519
elsif ($line =~ /$NOT_FILTER_REGEX/g) { } 0 1509 1509
elsif ($line =~ /$FILTER_ALL_REGEX/) { } 0 1509 1509
191 5 $filtered_status = 'UNTOUCHED';
192 } elsif ( $line =~ s/($FILTER_REGEX)\s*$/$replace/g ) {
193 10 $filtered_status = 'FILTERED ';
194 10 $filtered = $1;
195 } elsif ( $line =~ /$NOT_FILTER_REGEX/g ) {
196 0 $filtered_status = 'NOT-FILTERED';
197 } elsif ( $line =~ /$FILTER_ALL_REGEX/ ) { #and $line !~ /$not_filtered/ ) {
198 0 ▶ print STDERR __PACKAGE__, ":", __LINE__, ": ", "WARNING DEBUG LOG MESSAGE NOT REMOVED: $file : $linenum: $line \n" if ($ENV{WARN_FILTER} or ( $debug_this_package and $ENV{LOG_FILTER_DEBUG}));
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"WARN_FILTER"} or $debug_this_package and $ENV{"LOG_FILTER_DEBUG"} 0 0 0
Condition0%0/6
$ENV{"WARN_FILTER"} or $debug_this_package and $ENV{"LOG_FILTER_DEBUG"}
l!l&&r!l&&!r
000
$debug_this_package and $ENV{"LOG_FILTER_DEBUG"}
!ll&&!rl&&r
000
MC/DC0%0/3
$ENV{"WARN_FILTER"} or $debug_this_package and $ENV{"LOG_FILTER_DEBUG"}
$ENV{"WARN_FILTER"} $debug_this_package $ENV{"LOG_FILTER_DEBUG"}
Truth table0%0/4
A or B and C
A= $ENV{"WARN_FILTER"}B= $debug_this_packageC= $ENV{"LOG_FILTER_DEBUG"}
ABCresult
1XX1
0111
00X0
0100
199 0 $line =~ s/$FILTER_ALL_REGEX/${1}${2},${not_filtered}${3}${4}/;
200 0 $filtered_status = 'CHANGED';
201 }
202 1524 push @after, $line;
203 1524 ▶ print STDERR __PACKAGE__, ":", __LINE__, ": ", pad(++$ENV{GLOBAL_LINES_FILTER_EXAMINED},5), ' |', pad($linenum,5), '/', space($totallines,5),': ', space($filtered_status, undef, '.'), '| ', $line, "\n" if ($debug_this_package and $ENV{LOG_FILTER_DEBUG} > 3);
Branch: 1 branch
BranchTrueFalseTotal
if $debug_this_package and $ENV{"LOG_FILTER_DEBUG"} > 3 0 1524 1524
Condition33%1/3
$debug_this_package and $ENV{"LOG_FILTER_DEBUG"} > 3
!ll&&!rl&&r
015240
MC/DC0%0/2
$debug_this_package and $ENV{"LOG_FILTER_DEBUG"} > 3
$debug_this_package $ENV{"LOG_FILTER_DEBUG"} > 3
Truth table33%1/3
A and B
A= $debug_this_packageB= $ENV{"LOG_FILTER_DEBUG"} > 3
ABresult
0X0
100
111
204 1524 ▶ print STDERR __PACKAGE__, ":", __LINE__, ": ", pad('',5, 'x'), 'xx', pad('',5,'x'), 'x', space('',5,'x'),'::::: ', "FORMER CONTENTS: $filtered", "\n" if ( $debug_this_package and $ENV{LOG_FILTER_DEBUG} > 3 and $filtered );
Branch: 1 branch
BranchTrueFalseTotal
if $debug_this_package and $ENV{"LOG_FILTER_DEBUG"} > 3 and $filtered 0 1524 1524
Condition33%2/6
$debug_this_package and $ENV{"LOG_FILTER_DEBUG"} > 3 and $filtered
!ll&&!rl&&r
152400
$debug_this_package and $ENV{"LOG_FILTER_DEBUG"} > 3
!ll&&!rl&&r
015240
MC/DC0%0/3
$debug_this_package and $ENV{"LOG_FILTER_DEBUG"} > 3 and $filtered
$debug_this_package $ENV{"LOG_FILTER_DEBUG"} > 3 $filtered
Truth table25%1/4
A and B and C
A= $debug_this_packageB= $ENV{"LOG_FILTER_DEBUG"} > 3C= $filtered
ABCresult
0XX0
10X0
1100
1111
205 }
206 1 $_ = join( "\n", @after) . "\n";
207 1 };
208  
209 1 1;
« Log.pm ↑ Summary Log/Apache.pm »