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.004003'; #VERSION
4 1     1   10260 use Moo::Role;
  1         2  
  1         6  
5 1     1   327 use Log::Any;
  1         1  
  1         9  
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 731 my $self=shift;
15 1         3 my $category=shift;
16 1 50       6 if (defined $category)
17             {
18 1         5 return Log::Any->get_logger(category=>$category);
19             }
20 0           return $self->log;
21             }
22             1;
23              
24             __END__