line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Autocache::Logger; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
4918
|
use Any::Moose; |
|
5
|
|
|
|
|
290533
|
|
|
5
|
|
|
|
|
43
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
extends 'Exporter'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
has logger => (is => 'ro', isa => 'Object', handles => [qw(info debug warn error fatal)]); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @EXPORT_OK = qw(get_logger); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub get_logger { |
12
|
1111
|
|
|
1111
|
0
|
3420
|
return __PACKAGE__->singleton; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $SINGLETON; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub singleton { |
18
|
1111
|
|
|
1111
|
0
|
1392
|
my $class = shift; |
19
|
1111
|
100
|
|
|
|
2067
|
__PACKAGE__->initialise |
20
|
|
|
|
|
|
|
unless $SINGLETON; |
21
|
1111
|
|
|
|
|
4681
|
return $SINGLETON; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub initialise { |
25
|
5
|
|
|
5
|
0
|
12
|
my $class = shift; |
26
|
5
|
50
|
|
|
|
383
|
my %args = @_ ? @_ : (logger => Autocache::Logger::Null->new); |
27
|
5
|
|
|
|
|
407
|
$SINGLETON = $class->new(%args); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
5
|
|
|
5
|
|
4879
|
no Any::Moose; |
|
5
|
|
|
|
|
53
|
|
|
5
|
|
|
|
|
27
|
|
31
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
package Autocache::Logger::Null; |
34
|
|
|
|
|
|
|
|
35
|
5
|
|
|
5
|
|
22353
|
use Any::Moose; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
30
|
|
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
0
|
|
0
|
sub info {}; |
38
|
1111
|
|
|
1111
|
|
11431
|
sub debug {}; |
39
|
0
|
|
|
0
|
|
|
sub warn {}; |
40
|
0
|
|
|
0
|
|
|
sub error {}; |
41
|
0
|
|
|
0
|
|
|
sub fatal {}; |
42
|
|
|
|
|
|
|
|
43
|
5
|
|
|
5
|
|
3243
|
no Any::Moose; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
175
|
|
44
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |