line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Log::ger::Output::Callback; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $DATE = '2018-12-20'; # DATE |
4
|
|
|
|
|
|
|
our $VERSION = '0.004'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
11221
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
33
|
|
7
|
1
|
|
|
1
|
|
8
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
198
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub get_hooks { |
10
|
1
|
|
|
1
|
0
|
15
|
my %conf = @_; |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
|
|
3
|
my $hooks = {}; |
13
|
|
|
|
|
|
|
|
14
|
1
|
50
|
|
|
|
5
|
if ($conf{logging_cb}) { |
15
|
|
|
|
|
|
|
$hooks->{create_logml_routine} = [ |
16
|
|
|
|
|
|
|
__PACKAGE__, 50, |
17
|
|
|
|
|
|
|
sub { |
18
|
1
|
|
|
1
|
|
380
|
my %args = @_; |
19
|
|
|
|
|
|
|
my $logger = sub { |
20
|
3
|
|
|
|
|
670
|
$conf{logging_cb}->(@_); |
21
|
1
|
|
|
|
|
4
|
}; |
22
|
1
|
|
|
|
|
4
|
[$logger]; |
23
|
|
|
|
|
|
|
}, |
24
|
1
|
|
|
|
|
6
|
]; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
1
|
50
|
|
|
|
4
|
if ($conf{detection_cb}) { |
28
|
|
|
|
|
|
|
$hooks->{create_is_routine} = [ |
29
|
|
|
|
|
|
|
__PACKAGE__, 50, |
30
|
|
|
|
|
|
|
sub { |
31
|
0
|
|
|
0
|
|
0
|
my %args = @_; |
32
|
|
|
|
|
|
|
my $logger = sub { |
33
|
0
|
|
|
|
|
0
|
$conf{detection_cb}->($args{level}); |
34
|
0
|
|
|
|
|
0
|
}; |
35
|
0
|
|
|
|
|
0
|
[$logger]; |
36
|
|
|
|
|
|
|
}, |
37
|
0
|
|
|
|
|
0
|
]; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
1
|
|
|
|
|
4
|
return $hooks; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
# ABSTRACT: Send logs to a subroutine |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |