line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::Easy::Log::Tie; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
sub print_stderr { |
4
|
16
|
|
|
16
|
0
|
25
|
my $this = shift; |
5
|
16
|
|
|
|
|
48
|
my $stderr = $this->{STDERR}; |
6
|
|
|
|
|
|
|
|
7
|
16
|
100
|
|
|
|
74
|
if (!defined $stderr) { |
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# enabled, but no logging |
9
|
|
|
|
|
|
|
} elsif (ref($stderr) eq 'SCALAR') { |
10
|
8
|
|
|
|
|
24
|
$$stderr .= $_[0] ; |
11
|
|
|
|
|
|
|
} elsif (ref($stderr) eq 'CODE') { |
12
|
0
|
|
|
|
|
0
|
&$stderr($_[0]); |
13
|
|
|
|
|
|
|
} else { |
14
|
5
|
|
|
|
|
23
|
print $stderr $_[0]; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
16
|
|
|
|
|
29
|
return 1; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub TIESCALAR { |
21
|
9
|
|
|
9
|
|
17
|
my $class = shift; |
22
|
9
|
|
|
|
|
600
|
bless ({STDERR => $_[0]}, $class); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub TIEHANDLE { |
26
|
3
|
|
|
3
|
|
986
|
my $class = shift; |
27
|
3
|
|
|
|
|
23
|
bless ({STDERR => $_[0]}, $class); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub STORE { |
31
|
10
|
|
|
10
|
|
52
|
my $this = shift; |
32
|
|
|
|
|
|
|
|
33
|
10
|
|
|
|
|
44
|
$this->print_stderr (join ("", @_)); |
34
|
10
|
|
|
|
|
30
|
return 1; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub PRINT { |
39
|
6
|
|
|
6
|
|
19
|
my $this = shift; |
40
|
|
|
|
|
|
|
|
41
|
6
|
|
|
|
|
29
|
$this->print_stderr (join ("", @_)); |
42
|
6
|
|
|
|
|
15
|
return 1; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub PRINTF { |
46
|
0
|
|
|
0
|
|
|
&PRINT ($_[0], sprintf ($_[1], @_[2..$#_])); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
0
|
|
|
sub READ {} |
50
|
0
|
|
|
0
|
|
|
sub FETCH {} |
51
|
0
|
|
|
0
|
|
|
sub READLINE {} |
52
|
0
|
|
|
0
|
|
|
sub GETC {} |
53
|
0
|
|
|
0
|
|
|
sub WRITE {} |
54
|
0
|
|
|
0
|
|
|
sub FILENO {} |
55
|
0
|
|
|
0
|
|
|
sub CLOSE {} |
56
|
0
|
|
|
0
|
|
|
sub DESTROY {} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |