blib/lib/Gears/Logger/Handler.pm

filter: Statementstmt 100% 25 / 25 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 94.2% 33 / 35 CC 4 SCAR 8.6
CC
4
Cov
93%
_build_handler
4.1
BEGIN
1.0
BEGIN
1.0
CRAP 2.4
« blib/lib/Thunderhorse/Autoloadable.pm ↑ Summary blib/lib/Thunderhorse/Router.pm »
1 package Gears::Logger::Handler;
2 4 $Gears::Logger::Handler::VERSION = '0.107';
3 4 ▶use v5.40;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use Mooish::Base -standard;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 ▶use Gears::X::Logger;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 ▶use Log::Handler;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 4 extends 'Gears::Logger';
10  
11 4 has param 'outputs' => (
12 isa => ArrayRef,
13 );
14  
15 4 has field 'handler' => (
16 lazy => 1,
17 );
18  
19 1 ▶sub _build_handler ($self)
Subroutine _build_handler: called CC=4 SCAR=14.0
20 {
21 1 my @conf = $self->outputs->@*;
22 1 ▶ if (defined $self->log_format) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->log_format) 1 0 1
23 1 for my $conf_key (grep { $_ % 2 } keys @conf) {
24 1 my $name = $conf[$conf_key - 1];
25 1 my $conf = $conf[$conf_key];
26  
27 Gears::X::Logger->raise("both message_layout and logger's log_format specified for '$name'")
28 1 ▶ if exists $conf->{message_layout};
Branch: 1 branch
BranchTrueFalseTotal
if exists $conf->{"message_layout"} 0 1 1
29  
30 1 $conf->{message_layout} = '%m%N';
31 }
32 }
33  
34 1 return Log::Handler->new(@conf);
35 }
36  
37 4 ▶sub _log_message ($self, $level, $message)
Subroutine _log_message: called CC=1 SCAR=0.0
38 {
39 4 $self->handler->log($level, $message);
40 }
41  
« blib/lib/Thunderhorse/Autoloadable.pm ↑ Summary blib/lib/Thunderhorse/Router.pm »