line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Log::ger::Output::LogAny; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $DATE = '2017-06-26'; # DATE |
4
|
|
|
|
|
|
|
our $VERSION = '0.006'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
3112
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
32
|
|
7
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
227
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub get_hooks { |
10
|
1
|
|
|
1
|
0
|
18
|
my %conf = @_; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
return { |
13
|
|
|
|
|
|
|
create_log_routine => [ |
14
|
|
|
|
|
|
|
__PACKAGE__, 50, |
15
|
|
|
|
|
|
|
sub { |
16
|
3
|
|
|
3
|
|
748
|
my %args = @_; |
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
|
|
8
|
my $pkg; |
19
|
3
|
50
|
|
|
|
12
|
if ($args{target} eq 'package') { |
|
|
0
|
|
|
|
|
|
20
|
3
|
|
|
|
|
7
|
$pkg = $args{target_arg}; |
21
|
|
|
|
|
|
|
} elsif ($args{target} eq 'object') { |
22
|
0
|
|
|
|
|
0
|
$pkg = ref $args{target_arg}; |
23
|
|
|
|
|
|
|
} else { |
24
|
0
|
|
|
|
|
0
|
return []; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# use init_args as a per-target stash |
28
|
3
|
|
66
|
|
|
15
|
$args{init_args}{_la} ||= do { |
29
|
1
|
|
|
|
|
7
|
require Log::Any; |
30
|
1
|
|
|
|
|
10
|
Log::Any->get_logger(category => $pkg); |
31
|
|
|
|
|
|
|
}; |
32
|
|
|
|
|
|
|
|
33
|
3
|
|
|
|
|
260
|
my $meth = $args{str_level}; |
34
|
|
|
|
|
|
|
my $logger = sub { |
35
|
1
|
|
|
|
|
545
|
my $ctx = shift; |
36
|
1
|
|
|
|
|
9
|
$args{init_args}{_la}->$meth(@_); |
37
|
3
|
|
|
|
|
14
|
}; |
38
|
3
|
|
|
|
|
15
|
[$logger]; |
39
|
1
|
|
|
|
|
9
|
}], |
40
|
|
|
|
|
|
|
}; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
# ABSTRACT: Send logs to Log::Any |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |