line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Stomp::StupidLogger; |
2
|
11
|
|
|
11
|
|
37
|
use strict; |
|
11
|
|
|
|
|
20
|
|
|
11
|
|
|
|
|
265
|
|
3
|
11
|
|
|
11
|
|
36
|
use warnings; |
|
11
|
|
|
|
|
12
|
|
|
11
|
|
|
|
|
261
|
|
4
|
11
|
|
|
11
|
|
48
|
use Carp; |
|
11
|
|
|
|
|
12
|
|
|
11
|
|
|
|
|
2975
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.57'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
28
|
|
|
28
|
1
|
60029
|
my ($class,$levels) = @_; |
10
|
28
|
|
50
|
|
|
140
|
$levels||={}; |
11
|
28
|
|
|
|
|
48
|
for my $l (qw(warn error fatal)) { |
12
|
84
|
50
|
|
|
|
331
|
$levels->{$l}=1 unless defined $levels->{$l}; |
13
|
|
|
|
|
|
|
} |
14
|
28
|
|
|
|
|
239
|
return bless $levels,$class; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub _log { |
18
|
0
|
|
|
0
|
|
0
|
my ($self,$level,@etc) = @_; |
19
|
0
|
0
|
|
|
|
0
|
return unless $self->{$level}; |
20
|
0
|
|
|
|
|
0
|
carp join '',@etc; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
0
|
1
|
0
|
sub debug { my $self=shift;$self->_log(debug=>@_) } |
|
0
|
|
|
|
|
0
|
|
24
|
0
|
|
|
0
|
1
|
0
|
sub info { my $self=shift;$self->_log(info =>@_) } |
|
0
|
|
|
|
|
0
|
|
25
|
37
|
|
|
37
|
1
|
161
|
sub warn { my $self=shift;$self->_log(warn =>@_) } |
|
37
|
|
|
|
|
65
|
|
26
|
0
|
|
|
0
|
1
|
0
|
sub error { my $self=shift;$self->_log(error=>@_) } |
|
0
|
|
|
|
|
0
|
|
27
|
36
|
|
|
36
|
1
|
128
|
sub fatal { my $self=shift;$self->_log(fatal=>@_) } |
|
36
|
|
|
|
|
72
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |