Elasticsearch/Logger/LogAny.pm

filter: Statementstmt 96.6% 29 / 30 Branchbran 83.3% 5 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 95.4% 42 / 44 CC 4 SCAR 4.5
CC
4
Cov
94%
_build_deprecate_handle
2.1
_build_log_handle
2.0
_build_trace_handle
2.0
CRAP 1.6
« Elasticsearch/Transport.pm ↑ Summary Elasticsearch/Role/Client.pm »
1 package Search::Elasticsearch::Logger::LogAny;
2 55 $Search::Elasticsearch::Logger::LogAny::VERSION = '6.80';
3 55 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 55 with 'Search::Elasticsearch::Role::Logger';
5 55 ▶use Search::Elasticsearch::Util qw(parse_params to_list);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 55 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 55 ▶use Log::Any 1.02 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9 55 ▶use Log::Any::Adapter();
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 #===================================
12 sub _build_log_handle {
13 #===================================
14 99 ▶ my $self = shift;
Subroutine _build_log_handle: called CC=2 SCAR=6.9
15 99 ▶ if ( my @args = to_list( $self->log_to ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my(@args) = to_list($self->log_to)) 3 96 99
16 3 Log::Any::Adapter->set( { category => $self->log_as }, @args );
17 }
18 99 Log::Any->get_logger( category => $self->log_as );
19 }
20  
21 #===================================
22 sub _build_trace_handle {
23 #===================================
24 42 ▶ my $self = shift;
Subroutine _build_trace_handle: called CC=2 SCAR=6.9
25 42 ▶ if ( my @args = to_list( $self->trace_to ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my(@args) = to_list($self->trace_to)) 3 39 42
26 3 Log::Any::Adapter->set( { category => $self->trace_as }, @args );
27 }
28 42 Log::Any->get_logger( category => $self->trace_as );
29 }
30  
31 #===================================
32 sub _build_deprecate_handle {
33 #===================================
34 1 ▶ my $self = shift;
Subroutine _build_deprecate_handle: called CC=2 SCAR=7.6
35 1 ▶ if ( my @args = to_list( $self->deprecate_to ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my(@args) = to_list($self->deprecate_to)) 0 1 1
36 0 Log::Any::Adapter->set( { category => $self->deprecate_as }, @args );
37 }
38 Log::Any->get_logger(
39 1 default_adapter => 'Stderr',
40 category => $self->deprecate_as
41 );
42 }
43  
44 55 1;
45  
46 # ABSTRACT: A Log::Any-based Logger implementation
47  
48 __END__
« Elasticsearch/Transport.pm ↑ Summary Elasticsearch/Role/Client.pm »