| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Log::ger::Output::Array; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY |
|
4
|
|
|
|
|
|
|
our $DATE = '2020-03-11'; # DATE |
|
5
|
|
|
|
|
|
|
our $DIST = 'Log-ger'; # DIST |
|
6
|
|
|
|
|
|
|
our $VERSION = '0.037'; # VERSION |
|
7
|
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
25
|
use strict; |
|
|
4
|
|
|
|
|
8
|
|
|
|
4
|
|
|
|
|
105
|
|
|
9
|
4
|
|
|
4
|
|
17
|
use warnings; |
|
|
4
|
|
|
|
|
6
|
|
|
|
4
|
|
|
|
|
613
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub meta { +{ |
|
12
|
5
|
|
|
5
|
0
|
15
|
v => 2, |
|
13
|
|
|
|
|
|
|
} } |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub get_hooks { |
|
16
|
5
|
|
|
5
|
0
|
11
|
my %plugin_conf = @_; |
|
17
|
|
|
|
|
|
|
|
|
18
|
5
|
50
|
|
|
|
14
|
$plugin_conf{array} or die "Please specify array"; |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
return { |
|
21
|
|
|
|
|
|
|
create_outputter => [ |
|
22
|
|
|
|
|
|
|
__PACKAGE__, # key |
|
23
|
|
|
|
|
|
|
50, # priority |
|
24
|
|
|
|
|
|
|
sub { # hook |
|
25
|
54
|
|
|
54
|
|
156
|
my %hook_args = @_; # see Log::ger::Manual::Internals/"Arguments passed to hook" |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $outputter = sub { |
|
28
|
9
|
|
|
|
|
19
|
my ($per_target_conf, $msg, $per_msg_conf) = @_; |
|
29
|
9
|
|
|
|
|
25
|
push @{$plugin_conf{array}}, $msg; |
|
|
9
|
|
|
|
|
24
|
|
|
30
|
54
|
|
|
|
|
189
|
}; |
|
31
|
54
|
|
|
|
|
133
|
[$outputter]; |
|
32
|
5
|
|
|
|
|
35
|
}], |
|
33
|
|
|
|
|
|
|
}; |
|
34
|
|
|
|
|
|
|
} |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
|
37
|
|
|
|
|
|
|
# ABSTRACT: Log to array |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |