line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Log::ger::Plugin::OptAway; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $DATE = '2017-08-03'; # DATE |
4
|
|
|
|
|
|
|
our $VERSION = '0.005'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
61914
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
23
|
|
7
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
227
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub get_hooks { |
10
|
1
|
|
|
1
|
0
|
9
|
my %conf = @_; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
return { |
13
|
|
|
|
|
|
|
after_install_routines => [ |
14
|
|
|
|
|
|
|
__PACKAGE__, 99, |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub { |
17
|
3
|
|
|
3
|
|
4501
|
require B::CallChecker; |
18
|
3
|
|
|
|
|
1503
|
require B::Generate; |
19
|
|
|
|
|
|
|
|
20
|
3
|
|
|
|
|
1265
|
my %args = @_; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# we are only relevant when targetting package |
23
|
3
|
50
|
50
|
|
|
12
|
return [undef] unless ($args{target}||'') eq 'package'; |
24
|
|
|
|
|
|
|
|
25
|
3
|
|
|
|
|
5
|
for my $r (@{ $args{routines} }) { |
|
3
|
|
|
|
|
5
|
|
26
|
36
|
|
|
|
|
60
|
my ($code, $name, $lnum, $type) = @$r; |
27
|
36
|
50
|
|
|
|
90
|
next unless $type =~ /\A(log|is)_/; |
28
|
36
|
|
|
|
|
59
|
my $fullname = "$args{target_arg}\::$name"; |
29
|
|
|
|
|
|
|
#print "D:Current_Level = <$Log::ger::Current_Level>, r->[2] = <$r->[2]>\n"; |
30
|
36
|
100
|
|
|
|
63
|
if ($Log::ger::Current_Level < $r->[2]) { |
31
|
|
|
|
|
|
|
#print "D:no-oping $fullname\n"; |
32
|
|
|
|
|
|
|
B::CallChecker::cv_set_call_checker( |
33
|
14
|
|
|
|
|
70
|
\&{$fullname}, |
34
|
6
|
|
|
|
|
1180
|
sub { B::SVOP->new("const",0,!1) }, |
35
|
14
|
|
|
|
|
14
|
\!1, |
36
|
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
3
|
|
|
|
|
10
|
[1]; |
40
|
1
|
|
|
|
|
7
|
}], |
41
|
|
|
|
|
|
|
}; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
# ABSTRACT: Optimize away higher-level log statements |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |