Log/Log4perl.pm

filter: Statementstmt 44.6% 25 / 56 Branchbran 0.0% 0 / 18 Conditioncond 0.0% 0 / 18 MC/DCmcdc 0.0% 0 / 12 Subroutinesub 30.7% 8 / 26 Podpod 0.0% 0 / 18 totaltotal 22.3% 33 / 148 CC 17 SCAR 23.0
CC
17
Cov
27%
level
42.0
log
12.0
is_debug
6.0
CRAP 10.0
« Bot/BasicBot/Pluggable.pm ↑ Summary Bot/BasicBot/Pluggable/Module/Auth.pm »
1 package Irssi::Log::Log4perl;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use experimental 'signatures';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Log::Log4perl::Level;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 our $global_log_level = $DEBUG;
9  
10 0 ▶sub get_logger ($cls, $logger_cls) {
Subroutine get_logger: not called CC=1 SCAR=6.9
Pod undocumented
11 0 bless +{ class => $logger_cls } => __PACKAGE__
12 }
13  
14 0 ▶sub is_trace { undef }
Subroutine is_trace: not called CC=1 SCAR=6.9
Pod undocumented
15 0 ▶sub is_debug ($self) { ($self->{log_level} // $global_log_level) <= $DEBUG }
Subroutine is_debug: not called CC=2 SCAR=17.9
Pod undocumented
Condition0%0/3
$self->{"log_level"} // $Irssi::Log::Log4perl::global_log_level
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"log_level"} // $Irssi::Log::Log4perl::global_log_level
$self->{"log_level"} $Irssi::Log::Log4perl::global_log_level
Truth table0%0/3
A // B
A= $self->{"log_level"}B= $Irssi::Log::Log4perl::global_log_level
ABresult
1X1
011
000
16 0 ▶sub is_info ($self) { ($self->{log_level} // $global_log_level) <= $INFO }
Subroutine is_info: not called CC=2 SCAR=17.9
Pod undocumented
Condition0%0/3
$self->{"log_level"} // $Irssi::Log::Log4perl::global_log_level
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"log_level"} // $Irssi::Log::Log4perl::global_log_level
$self->{"log_level"} $Irssi::Log::Log4perl::global_log_level
Truth table0%0/3
A // B
A= $self->{"log_level"}B= $Irssi::Log::Log4perl::global_log_level
ABresult
1X1
011
000
17 0 ▶sub is_warn ($self) { ($self->{log_level} // $global_log_level) <= $WARN }
Subroutine is_warn: not called CC=2 SCAR=17.9
Pod undocumented
Condition0%0/3
$self->{"log_level"} // $Irssi::Log::Log4perl::global_log_level
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"log_level"} // $Irssi::Log::Log4perl::global_log_level
$self->{"log_level"} $Irssi::Log::Log4perl::global_log_level
Truth table0%0/3
A // B
A= $self->{"log_level"}B= $Irssi::Log::Log4perl::global_log_level
ABresult
1X1
011
000
18 0 ▶sub is_error ($self) { ($self->{log_level} // $global_log_level) <= $ERROR }
Subroutine is_error: not called CC=2 SCAR=17.9
Pod undocumented
Condition0%0/3
$self->{"log_level"} // $Irssi::Log::Log4perl::global_log_level
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"log_level"} // $Irssi::Log::Log4perl::global_log_level
$self->{"log_level"} $Irssi::Log::Log4perl::global_log_level
Truth table0%0/3
A // B
A= $self->{"log_level"}B= $Irssi::Log::Log4perl::global_log_level
ABresult
1X1
011
000
19 0 ▶sub is_fatal { 1 }
Subroutine is_fatal: not called CC=1 SCAR=6.9
Pod undocumented
20  
21 0 ▶sub level ($self, $level = undef) {
Subroutine level: not called CC=6 SCAR=37.4
Pod undocumented
22 0 ▶ if (ref $self) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $self) { } 0 0 0
23 0 my $old = $self->{log_level};
24 0 ▶ $self->{log_level} = $level
Branch: 1 branch
BranchTrueFalseTotal
if defined $level 0 0 0
25 if defined $level;
26 0 ▶ return $old // $global_log_level;
Condition0%0/3
$old // $Irssi::Log::Log4perl::global_log_level
l!l&&r!l&&!r
000
MC/DC0%0/2
$old // $Irssi::Log::Log4perl::global_log_level
$old $Irssi::Log::Log4perl::global_log_level
Truth table0%0/3
A // B
A= $oldB= $Irssi::Log::Log4perl::global_log_level
ABresult
1X1
011
000
27 } else {
28 0 my $old = $global_log_level;
29 0 ▶ $global_log_level = $level
Branch: 1 branch
BranchTrueFalseTotal
if defined $level 0 0 0
30 if defined $level;
31 0 return $global_log_level;
32 }
33 }
34  
35 0 ▶sub trace { undef }
Subroutine trace: not called CC=1 SCAR=6.9
Pod undocumented
36 0 ▶sub debug ($self, @message) { return unless $self->is_debug;
Subroutine debug: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
unless $self->is_debug 0 0 0
37 0 $self->print('DEBUG', @message); }
38 0 ▶sub info ($self, @message) { return unless $self->is_info;
Subroutine info: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
unless $self->is_info 0 0 0
39 0 $self->print('INFO', @message); }
40 0 ▶sub warn ($self, @message) { return unless $self->is_warn;
Subroutine warn: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
unless $self->is_warn 0 0 0
41 0 $self->print('WARN', @message); }
42 0 ▶sub error ($self, @message) { return unless $self->is_error;
Subroutine error: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
unless $self->is_error 0 0 0
43 0 $self->print('ERROR', @message); }
44 0 ▶sub fatal ($self, @message) { $self->print('FATAL', @message); }
Subroutine fatal: not called CC=1 SCAR=6.9
Pod undocumented
45 0 ▶sub log ($self, $level, @message) {
Subroutine log: not called CC=3 SCAR=24.8
Pod undocumented
46 0 ▶ return unless ($self->{log_level} // $global_log_level) <= $level;
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"log_level"} // $Irssi::Log::Log4perl::global_log_level) <= $level 0 0 0
Condition0%0/3
$self->{"log_level"} // $Irssi::Log::Log4perl::global_log_level
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"log_level"} // $Irssi::Log::Log4perl::global_log_level
$self->{"log_level"} $Irssi::Log::Log4perl::global_log_level
Truth table0%0/3
A // B
A= $self->{"log_level"}B= $Irssi::Log::Log4perl::global_log_level
ABresult
1X1
011
000
47 0 $self->print($Log::Log4perl::Level::LEVELS{ $level }, @message);
48 }
49  
50 0 ▶sub print ($self, $level, @message) {
Subroutine print: not called CC=2 SCAR=17.9
Pod undocumented
51 0 ▶ print "[$level] " . ($self->{class} ? "[$self->{class}] " : "")
Branch: 1 branch
BranchTrueFalseTotal
$self->{'class'} ? : 0 0 0
52 . (join "", @message);
53 }
54  
55 0 ▶sub logdie ($self, @message) {
Subroutine logdie: not called CC=1 SCAR=6.9
Pod undocumented
56 0 $self->fatal(@message);
57 0 die;
58 }
59  
60 1 1;
61  
62 package #
63 Log::Log4perl;
64 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
65 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
66 1 ▶use base 'Irssi::Log::Log4perl';
Subroutine BEGIN: called CC=1 SCAR=0.0
67 1 ▶BEGIN { $INC{'Log/Log4perl.pm'} = __FILE__; }
Subroutine BEGIN: called CC=1 SCAR=0.0
68  
69 0 ▶sub DUMMY { 1 }
Subroutine DUMMY: not called CC=1 SCAR=6.9
Pod undocumented
70  
71 1 1;
« Bot/BasicBot/Pluggable.pm ↑ Summary Bot/BasicBot/Pluggable/Module/Auth.pm »