File Coverage

blib/lib/MooX/Log/Any.pm
Criterion Covered Total %
statement 10 11 90.9
branch 1 2 50.0
condition n/a
subroutine 3 3 100.0
pod 1 1 100.0
total 15 17 88.2


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__