blib/lib/Class/Easy/Log/Tie.pm

filter: Statementstmt 89.4% 17 / 19 Branchbran 83.3% 5 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 35.7% 5 / 14 Podpod 0.0% 0 / 1 totaltotal 67.5% 27 / 40 CC 4 SCAR 5.8
CC
4
Cov
88%
print_stderr
4.1
PRINTF
2.0
TIESCALAR
1.0
CRAP 1.8
« blib/lib/Class/Easy/PP.pm ↑ Summary Easy.xs »
1 package Class::Easy::Log::Tie;
2  
3 16 ▶sub print_stderr {
Subroutine print_stderr: called CC=4 SCAR=14.0
Pod undocumented
4 16 my $this = shift;
5 16 my $stderr = $this->{STDERR};
6
7 16 ▶ if (!defined $stderr) {
Branch: 3 branches
BranchTrueFalseTotal
if (not defined $stderr) { } 3 13 16
elsif (ref $stderr eq 'SCALAR') { } 8 5 13
elsif (ref $stderr eq 'CODE') { } 0 5 5
8 # enabled, but no logging
9 } elsif (ref($stderr) eq 'SCALAR') {
10 8 $$stderr .= $_[0] ;
11 } elsif (ref($stderr) eq 'CODE') {
12 0 &$stderr($_[0]);
13 } else {
14 5 print $stderr $_[0];
15 }
16
17 16 return 1;
18 }
19  
20 8 ▶sub TIESCALAR {
Subroutine TIESCALAR: called CC=1 SCAR=0.0
21 8 my $class = shift;
22 8 bless ({STDERR => $_[0]}, $class);
23 }
24  
25 3 ▶sub TIEHANDLE {
Subroutine TIEHANDLE: called CC=1 SCAR=0.0
26 3 my $class = shift;
27 3 bless ({STDERR => $_[0]}, $class);
28 }
29  
30 10 ▶sub STORE {
Subroutine STORE: called CC=1 SCAR=0.0
31 10 my $this = shift;
32
33 10 $this->print_stderr (join ("", @_));
34 10 return 1;
35 }
36  
37  
38 6 ▶sub PRINT {
Subroutine PRINT: called CC=1 SCAR=0.0
39 6 my $this = shift;
40
41 6 $this->print_stderr (join ("", @_));
42 6 return 1;
43 }
44  
45 0 ▶sub PRINTF {
Subroutine PRINTF: not called CC=1 SCAR=6.9
46 0 &PRINT ($_[0], sprintf ($_[1], @_[2..$#_]));
47 }
48  
49 0 ▶sub READ {}
Subroutine READ: not called CC=1 SCAR=0.0
50 0 ▶sub FETCH {}
Subroutine FETCH: not called CC=1 SCAR=0.0
51 0 ▶sub READLINE {}
Subroutine READLINE: not called CC=1 SCAR=0.0
52 0 ▶sub GETC {}
Subroutine GETC: not called CC=1 SCAR=0.0
53 0 ▶sub WRITE {}
Subroutine WRITE: not called CC=1 SCAR=0.0
54 0 ▶sub FILENO {}
Subroutine FILENO: not called CC=1 SCAR=0.0
55 0 ▶sub CLOSE {}
Subroutine CLOSE: not called CC=1 SCAR=0.0
56 0 ▶sub DESTROY {}
Subroutine DESTROY: not called CC=1 SCAR=0.0
57  
58 5 1;
« blib/lib/Class/Easy/PP.pm ↑ Summary Easy.xs »