line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Log::ger::Plugin::LogAny; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY |
4
|
|
|
|
|
|
|
our $DATE = '2020-03-11'; # DATE |
5
|
|
|
|
|
|
|
our $DIST = 'Log-ger-Like-LogAny'; # DIST |
6
|
|
|
|
|
|
|
our $VERSION = '0.006'; # VERSION |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
489
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
9
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
20
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
4
|
use Log::ger (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
252
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub meta { +{ |
14
|
2
|
|
|
2
|
0
|
54
|
v => 2, |
15
|
|
|
|
|
|
|
} } |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub get_hooks { |
18
|
2
|
|
|
2
|
0
|
25
|
my %plugin_conf = @_; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
return { |
21
|
|
|
|
|
|
|
create_formatter => [ |
22
|
|
|
|
|
|
|
__PACKAGE__, 50, |
23
|
|
|
|
|
|
|
sub { |
24
|
|
|
|
|
|
|
my $formatter = sub { |
25
|
1
|
|
|
|
|
3399
|
return join " ", @_; |
26
|
3
|
|
|
3
|
|
1291
|
}; |
27
|
3
|
|
|
|
|
10
|
return [$formatter, 0, 'join']; |
28
|
|
|
|
|
|
|
}, |
29
|
|
|
|
|
|
|
], |
30
|
|
|
|
|
|
|
create_routine_names => [ |
31
|
|
|
|
|
|
|
__PACKAGE__, # key |
32
|
|
|
|
|
|
|
50, # priority |
33
|
|
|
|
|
|
|
sub { |
34
|
3
|
|
|
3
|
|
236
|
my %hook_args = @_; |
35
|
|
|
|
|
|
|
|
36
|
3
|
|
|
|
|
14
|
my $levels = [keys %Log::ger::Levels]; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
return [{ |
39
|
42
|
|
|
|
|
99
|
logger_subs => [map { (["log_$_", $_, "join"], ["log_${_}f", $_, "default"]) } |
40
|
|
|
|
|
|
|
@$levels], |
41
|
42
|
|
|
|
|
66
|
level_checker_subs => [map { ["log_is_$_", $_] } @$levels], |
42
|
42
|
|
|
|
|
106
|
logger_methods => [map { (["$_", $_, "join"], ["${_}f", $_, "default"]) } |
43
|
|
|
|
|
|
|
@$levels], |
44
|
3
|
|
|
|
|
9
|
level_checker_methods => [map { ["is_$_", $_] } @$levels], |
|
42
|
|
|
|
|
104
|
|
45
|
|
|
|
|
|
|
}, 1]; |
46
|
2
|
|
|
|
|
30
|
}], |
47
|
|
|
|
|
|
|
}; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
# ABSTRACT: Plugin to mimic Log::Any |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__END__ |