DeploymentHandler/Logger.pm

filter: Statementstmt 54.8% 17 / 31 Branchbran 16.6% 2 / 12 Conditioncond 10.5% 2 / 19 MC/DCmcdc 0.0% 0 / 11 Subroutinesub 60.0% 6 / 10 Podpod 100% 6 / 6 totaltotal 37.0% 33 / 89 CC 15 SCAR 24.3
CC
15
Cov
34%
is_warn
20.0
is_error
20.0
is_fatal
20.0
CRAP 11.4
↑ Summary DeploymentHandler/VersionStorage/Deprecated/Component.pm »
1 package DBIx::Class::DeploymentHandler::Logger;
2 20 $DBIx::Class::DeploymentHandler::Logger::VERSION = '0.002233';
3 20 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 20 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 20 ▶use parent 'Log::Contextual::WarnLogger';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 # trace works the way we want it already
9  
10 # sub is_trace { $_[0]->next::method }
11 284 ▶sub is_debug { $_[0]->is_trace || $_[0]->next::method }
Subroutine is_debug: called CC=2 SCAR=7.6
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
$_[0]->is_trace or $_[0]->next::method 284 0 284
12 173 ▶sub is_info { $_[0]->is_debug || $_[0]->next::method }
Subroutine is_info: called CC=2 SCAR=7.6
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
$_[0]->is_debug or $_[0]->next::method 173 0 173
13  
14 sub is_warn {
15 0 ▶ my $orig = $_[0]->next::method;
Subroutine is_warn: not called CC=4 SCAR=30.0
Pod documented
16 0 ▶ return undef if defined $orig && !$orig;
Branch: 1 branch
BranchTrueFalseTotal
if defined $orig and not $orig 0 0 0
Condition0%0/3
defined $orig and not $orig
!ll&&!rl&&r
000
MC/DC0%0/2
defined $orig and not $orig
defined $orig not $orig
Truth table0%0/3
A and not(B)
A= defined $origB= not $orig
ABresult
0X0
100
111
17 0 ▶ return $_[0]->is_info || 1
Condition0%0/2
$_[0]->is_info || 1
l!l
00
MC/DC0%0/1
$_[0]->is_info || 1
$_[0]->is_info
Truth table0%0/2
A
A= $_[0]->is_info
Aresult
11
00
18 }
19  
20 sub is_error {
21 0 ▶ my $orig = $_[0]->next::method;
Subroutine is_error: not called CC=4 SCAR=30.0
Pod documented
22 0 ▶ return undef if defined $orig && !$orig;
Branch: 1 branch
BranchTrueFalseTotal
if defined $orig and not $orig 0 0 0
Condition0%0/3
defined $orig and not $orig
!ll&&!rl&&r
000
MC/DC0%0/2
defined $orig and not $orig
defined $orig not $orig
Truth table0%0/3
A and not(B)
A= defined $origB= not $orig
ABresult
0X0
100
111
23 0 ▶ return $_[0]->is_warn || 1
Condition0%0/2
$_[0]->is_warn || 1
l!l
00
MC/DC0%0/1
$_[0]->is_warn || 1
$_[0]->is_warn
Truth table0%0/2
A
A= $_[0]->is_warn
Aresult
11
00
24 }
25  
26 sub is_fatal {
27 0 ▶ my $orig = $_[0]->next::method;
Subroutine is_fatal: not called CC=4 SCAR=30.0
Pod documented
28 0 ▶ return undef if defined $orig && !$orig;
Branch: 1 branch
BranchTrueFalseTotal
if defined $orig and not $orig 0 0 0
Condition0%0/3
defined $orig and not $orig
!ll&&!rl&&r
000
MC/DC0%0/2
defined $orig and not $orig
defined $orig not $orig
Truth table0%0/3
A and not(B)
A= defined $origB= not $orig
ABresult
0X0
100
111
29 0 ▶ return $_[0]->is_error || 1
Condition0%0/2
$_[0]->is_error || 1
l!l
00
MC/DC0%0/1
$_[0]->is_error || 1
$_[0]->is_error
Truth table0%0/2
A
A= $_[0]->is_error
Aresult
11
00
30 }
31  
32 sub _log {
33 0 ▶ my $self = shift;
Subroutine _log: not called CC=2 SCAR=17.9
34 0 my $level = shift;
35 0 my $message = join( "\n", @_ );
36 0 ▶ $message .= "\n" unless $message =~ /\n$/;
Branch: 1 branch
BranchTrueFalseTotal
unless $message =~ /\n$/ 0 0 0
37 0 warn "[DBICDH] [$level] $message";
38 }
39  
40 sub new {
41 19 ▶ my ($self, $options, @rest) = @_;
Subroutine new: called CC=3 SCAR=11.4
Pod documented
42  
43 19 ▶ $options ||= {};
Condition50%1/2
$options ||= {}
l!l
019
MC/DC0%0/1
$options ||= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
44 19 ▶ $options->{env_prefix} ||= 'DBICDH';
Condition50%1/2
$options->{"env_prefix"} ||= "DBICDH"
l!l
019
MC/DC0%0/1
$options->{"env_prefix"} ||= "DBICDH"
$options->{"env_prefix"}
Truth table50%1/2
A
A= $options->{"env_prefix"}
Aresult
11
00
45  
46 19 $self->next::method($options, @rest)
47 }
48  
49 20 1;
↑ Summary DeploymentHandler/VersionStorage/Deprecated/Component.pm »