line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Role to add Log::Any |
2
|
|
|
|
|
|
|
package MooX::Log::Any; |
3
|
|
|
|
|
|
|
our $VERSION = '0.004002'; #VERSION |
4
|
1
|
|
|
1
|
|
8236
|
use Moo::Role; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
5
|
1
|
|
|
1
|
|
287
|
use Log::Any; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
6
|
|
|
|
|
|
|
local $| = 1; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has 'log' => ( |
9
|
|
|
|
|
|
|
is => 'ro', |
10
|
|
|
|
|
|
|
lazy => 1, |
11
|
|
|
|
|
|
|
default => sub { Log::Any->get_logger(); }, |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
sub logger { |
14
|
1
|
|
|
1
|
1
|
778
|
my $self=shift; |
15
|
1
|
|
|
|
|
2
|
my $category=shift; |
16
|
1
|
50
|
|
|
|
3
|
if (defined $category) |
17
|
|
|
|
|
|
|
{ |
18
|
1
|
|
|
|
|
4
|
return Log::Any->get_logger(category=>$category); |
19
|
|
|
|
|
|
|
} |
20
|
0
|
|
|
|
|
|
return $self->log; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
1; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
__END__ |