line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Log::ger::Plugin::SingleLog; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $DATE = '2017-06-28'; # DATE |
4
|
|
|
|
|
|
|
our $VERSION = '0.001'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
21061
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
25
|
|
7
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
5
|
use Log::ger::Util; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
234
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub get_hooks { |
12
|
1
|
|
|
1
|
0
|
11
|
my %conf = @_; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
50
|
|
|
8
|
$conf{sub_name} //= "log"; |
15
|
1
|
|
50
|
|
|
6
|
$conf{method_name} //= "log"; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
return { |
18
|
|
|
|
|
|
|
before_install_routines => [ |
19
|
|
|
|
|
|
|
__PACKAGE__, 99, |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub { |
22
|
1
|
|
|
1
|
|
805
|
my %args = @_; |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
|
|
2
|
my @logger_subs; |
25
|
1
|
|
|
|
|
2
|
for (@{ $args{routines} }) { |
|
1
|
|
|
|
|
3
|
|
26
|
12
|
100
|
66
|
|
|
44
|
$logger_subs[$_->[2]] = $_->[0] if $_->[3] & 1 && !($_->[3] & 2); |
27
|
|
|
|
|
|
|
} |
28
|
1
|
|
|
|
|
2
|
my @logger_methods; |
29
|
1
|
|
|
|
|
2
|
for (@{ $args{routines} }) { |
|
1
|
|
|
|
|
2
|
|
30
|
12
|
50
|
66
|
|
|
37
|
$logger_methods[$_->[2]] = $_->[0] if $_->[3] & 1 && ($_->[3] & 2); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
1
|
|
|
|
|
4
|
push @{ $args{routines} }, [ |
34
|
|
|
|
|
|
|
sub { |
35
|
1
|
|
|
1
|
|
13
|
my $level = Log::ger::Util::numeric_level(shift); |
36
|
1
|
|
|
|
|
12
|
goto &{$logger_subs[$level]}; |
|
1
|
|
|
|
|
6
|
|
37
|
|
|
|
|
|
|
}, |
38
|
|
|
|
|
|
|
$conf{sub_name}, |
39
|
1
|
|
|
|
|
2
|
-1, |
40
|
|
|
|
|
|
|
1 | 0, |
41
|
|
|
|
|
|
|
]; |
42
|
1
|
|
|
|
|
4
|
push @{ $args{routines} }, [ |
43
|
|
|
|
|
|
|
sub { |
44
|
0
|
|
|
|
|
0
|
shift; |
45
|
0
|
|
|
|
|
0
|
my $level = Log::ger::Util::numeric_level(shift); |
46
|
0
|
|
|
|
|
0
|
goto &{$logger_methods[$level]}; |
|
0
|
|
|
|
|
0
|
|
47
|
|
|
|
|
|
|
}, |
48
|
|
|
|
|
|
|
$conf{method_name}, |
49
|
1
|
|
|
|
|
7
|
-1, |
50
|
|
|
|
|
|
|
1 | 2, |
51
|
|
|
|
|
|
|
]; |
52
|
|
|
|
|
|
|
|
53
|
1
|
|
|
|
|
4
|
[1]; |
54
|
1
|
|
|
|
|
8
|
}], |
55
|
|
|
|
|
|
|
}; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |
59
|
|
|
|
|
|
|
# ABSTRACT: Create a log($LEVEL, ...) subroutine/method |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__END__ |