| 1 | # Licensed to Elasticsearch B.V under one or more agreements. | ||||||||||
| 2 | # Elasticsearch B.V licenses this file to you under the Apache 2.0 License. | ||||||||||
| 3 | # See the LICENSE file in the project root for more information | ||||||||||
| 4 | |||||||||||
| 5 | package Search::Elasticsearch::Logger::LogAny; | ||||||||||
| 6 | 55 | $Search::Elasticsearch::Logger::LogAny::VERSION = '7.30_1'; # TRIAL | |||||||||
| 7 | |||||||||||
| 8 | 55 | $Search::Elasticsearch::Logger::LogAny::VERSION = '7.301'; | |||||||||
| 9 | 55 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 55 | with 'Search::Elasticsearch::Role::Logger'; | |||||||||
| 11 | 55 | ▶ | use Search::Elasticsearch::Util qw(parse_params to_list); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 55 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 55 | ▶ | use Log::Any 1.02 (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | 55 | ▶ | use Log::Any::Adapter(); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | |||||||||||
| 17 | #=================================== | ||||||||||
| 18 | sub _build_log_handle { | ||||||||||
| 19 | #=================================== | ||||||||||
| 20 | 99 | ▶ | my $self = shift; | ||||||||
|
Subroutine
_build_log_handle: called CC=2 SCAR=6.9
| |||||||||||
| 21 | 99 | ▶ | if ( my @args = to_list( $self->log_to ) ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 3 | Log::Any::Adapter->set( { category => $self->log_as }, @args ); | |||||||||
| 23 | } | ||||||||||
| 24 | 99 | Log::Any->get_logger( category => $self->log_as ); | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | #=================================== | ||||||||||
| 28 | sub _build_trace_handle { | ||||||||||
| 29 | #=================================== | ||||||||||
| 30 | 42 | ▶ | my $self = shift; | ||||||||
|
Subroutine
_build_trace_handle: called CC=2 SCAR=6.9
| |||||||||||
| 31 | 42 | ▶ | if ( my @args = to_list( $self->trace_to ) ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | 3 | Log::Any::Adapter->set( { category => $self->trace_as }, @args ); | |||||||||
| 33 | } | ||||||||||
| 34 | 42 | Log::Any->get_logger( category => $self->trace_as ); | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | #=================================== | ||||||||||
| 38 | sub _build_deprecate_handle { | ||||||||||
| 39 | #=================================== | ||||||||||
| 40 | 1 | ▶ | my $self = shift; | ||||||||
|
Subroutine
_build_deprecate_handle: called CC=2 SCAR=7.6
| |||||||||||
| 41 | 1 | ▶ | if ( my @args = to_list( $self->deprecate_to ) ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 42 | 0 | Log::Any::Adapter->set( { category => $self->deprecate_as }, @args ); | |||||||||
| 43 | } | ||||||||||
| 44 | Log::Any->get_logger( | ||||||||||
| 45 | 1 | default_adapter => 'Stderr', | |||||||||
| 46 | category => $self->deprecate_as | ||||||||||
| 47 | ); | ||||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | 55 | 1; | |||||||||
| 51 | |||||||||||
| 52 | # ABSTRACT: A Log::Any-based Logger implementation | ||||||||||
| 53 | |||||||||||
| 54 | __END__ | ||||||||||