line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Log::Minimal::Object; |
2
|
2
|
|
|
2
|
|
1651
|
use 5.008005; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
72
|
|
3
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
70
|
|
4
|
2
|
|
|
2
|
|
19
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
51
|
|
5
|
2
|
|
|
2
|
|
1879
|
use Log::Minimal (); |
|
2
|
|
|
|
|
54862
|
|
|
2
|
|
|
|
|
126
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = "0.02"; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use constant { |
10
|
2
|
|
|
|
|
1202
|
ORIGINAL_PRINT => $Log::Minimal::PRINT, |
11
|
|
|
|
|
|
|
ORIGINAL_DIE => $Log::Minimal::DIE, |
12
|
|
|
|
|
|
|
DEFAULT_TRACE_LEVEL => 2, |
13
|
2
|
|
|
2
|
|
23
|
}; |
|
2
|
|
|
|
|
4
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new { |
16
|
7
|
|
|
7
|
1
|
11510
|
my $class = shift; |
17
|
|
|
|
|
|
|
|
18
|
7
|
50
|
|
|
|
41
|
my %args = scalar @_ == 1 ? %{$_[0]} : @_; |
|
0
|
|
|
|
|
0
|
|
19
|
|
|
|
|
|
|
|
20
|
7
|
|
100
|
|
|
215
|
bless { |
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
21
|
|
|
|
|
|
|
color => $args{color} || 0, |
22
|
|
|
|
|
|
|
die => $args{die} || ORIGINAL_DIE, |
23
|
|
|
|
|
|
|
print => $args{print} || ORIGINAL_PRINT, |
24
|
|
|
|
|
|
|
autodump => $args{autodump} || 0, |
25
|
|
|
|
|
|
|
trace_level => $args{trace_level} || DEFAULT_TRACE_LEVEL, |
26
|
|
|
|
|
|
|
log_level => $args{log_level} || 'DEBUG', |
27
|
|
|
|
|
|
|
escape_whitespace => $args{escape_whitespace} || 0, |
28
|
|
|
|
|
|
|
}, $class; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
1
|
|
|
1
|
0
|
13
|
sub critf { shift->_log('critf', @_) } |
32
|
4
|
|
|
4
|
0
|
507
|
sub warnf { shift->_log('warnf', @_) } |
33
|
5
|
|
|
5
|
0
|
3637
|
sub infof { shift->_log('infof', @_) } |
34
|
1
|
|
|
1
|
0
|
56
|
sub debugf { shift->_log('debugf', @_) } |
35
|
1
|
|
|
1
|
0
|
10
|
sub critff { shift->_log('critff', @_) } |
36
|
1
|
|
|
1
|
0
|
96
|
sub warnff { shift->_log('warnff', @_) } |
37
|
1
|
|
|
1
|
0
|
89
|
sub infoff { shift->_log('infoff', @_) } |
38
|
1
|
|
|
1
|
0
|
95
|
sub debugff { shift->_log('debugff', @_) } |
39
|
2
|
|
|
2
|
0
|
290
|
sub croakf { shift->_log('croakf', @_) } |
40
|
1
|
|
|
1
|
0
|
448
|
sub croakff { shift->_log('croakff', @_) } |
41
|
1
|
|
|
1
|
0
|
32
|
sub ddf { shift->_log('ddf', @_) } |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub _log { |
44
|
19
|
|
|
19
|
|
31
|
my $self = shift; |
45
|
19
|
|
|
|
|
26
|
my $meth = shift; |
46
|
|
|
|
|
|
|
|
47
|
19
|
|
|
|
|
36
|
local $Log::Minimal::COLOR = $self->{color}; |
48
|
19
|
|
|
|
|
29
|
local $Log::Minimal::AUTODUMP = $self->{autodump}; |
49
|
19
|
|
|
|
|
39
|
local $Log::Minimal::TRACE_LEVEL = $self->{trace_level}; |
50
|
19
|
|
|
|
|
33
|
local $Log::Minimal::LOG_LEVEL = $self->{log_level}; |
51
|
19
|
|
|
|
|
25
|
local $Log::Minimal::DIE = $self->{die}; |
52
|
19
|
|
|
|
|
27
|
local $Log::Minimal::PRINT = $self->{print}; |
53
|
19
|
|
|
|
|
25
|
local $Log::Minimal::ESCAPE_WHITESPACE = $self->{escape_whitespace}; |
54
|
|
|
|
|
|
|
|
55
|
19
|
|
33
|
|
|
157
|
$self->{$meth} ||= Log::Minimal->can($meth); |
56
|
19
|
|
|
|
|
76
|
$self->{$meth}->(@_); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
__END__ |