line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Message::Passing::Output::Log::Any::Adapter; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Message::Passing::Output::Log::Any::Adapter::VERSION = '0.002'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: output messages via Log::Any::Adapter. |
7
|
2
|
|
|
2
|
|
51610
|
use Moo; |
|
2
|
|
|
|
|
47372
|
|
|
2
|
|
|
|
|
15
|
|
8
|
2
|
|
|
2
|
|
6666
|
use MooX::Types::MooseLike::Base qw( Str ArrayRef ); |
|
2
|
|
|
|
|
19977
|
|
|
2
|
|
|
|
|
249
|
|
9
|
2
|
|
|
2
|
|
2203
|
use Log::Any qw( $log ); |
|
2
|
|
|
|
|
5145
|
|
|
2
|
|
|
|
|
10
|
|
10
|
2
|
|
|
2
|
|
1952
|
use Log::Any::Adapter; |
|
2
|
|
|
|
|
28681
|
|
|
2
|
|
|
|
|
17
|
|
11
|
2
|
|
|
2
|
|
2049
|
use namespace::clean -except => 'meta'; |
|
2
|
|
|
|
|
40406
|
|
|
2
|
|
|
|
|
18
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has adapter_name => ( |
15
|
|
|
|
|
|
|
is => 'ro', |
16
|
|
|
|
|
|
|
isa => Str, |
17
|
|
|
|
|
|
|
required => 1, |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
has adapter_params => ( |
21
|
|
|
|
|
|
|
is => 'ro', |
22
|
|
|
|
|
|
|
isa => ArrayRef, |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub BUILD { |
26
|
2
|
|
|
2
|
0
|
11777
|
my $self = shift; |
27
|
|
|
|
|
|
|
|
28
|
2
|
|
|
|
|
12
|
my @params = ( $self->adapter_name ); |
29
|
2
|
100
|
|
|
|
16
|
push @params, @{ $self->adapter_params } |
|
1
|
|
|
|
|
5
|
|
30
|
|
|
|
|
|
|
if defined $self->adapter_params; |
31
|
|
|
|
|
|
|
|
32
|
2
|
|
|
|
|
17
|
Log::Any::Adapter->set(@params); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub consume { |
36
|
2
|
|
|
2
|
1
|
28687
|
my ( $self, $msg ) = @_; |
37
|
|
|
|
|
|
|
|
38
|
2
|
|
|
|
|
7
|
my $severity = 'info'; |
39
|
|
|
|
|
|
|
|
40
|
2
|
|
|
|
|
14
|
$log->$severity($msg); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
with 'Message::Passing::Role::Output'; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |