File Coverage

blib/lib/Log/ger/Output/DirWriteRotate.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 19 20 95.0


line stmt bran cond sub pod time code
1             package Log::ger::Output::DirWriteRotate;
2              
3             our $DATE = '2017-06-26'; # DATE
4             our $VERSION = '0.002'; # VERSION
5              
6 1     1   2828 use strict;
  1         3  
  1         23  
7 1     1   4 use warnings;
  1         2  
  1         114  
8              
9             sub get_hooks {
10 1     1 0 14 my %conf = @_;
11              
12 1         464 require Dir::Write::Rotate;
13 1         1372 my $dwr = Dir::Write::Rotate->new(%conf);
14              
15             return {
16             create_log_routine => [
17             __PACKAGE__, 50,
18             sub {
19 6     6   1954 my %args = @_;
20              
21             my $logger = sub {
22 2         6286 my ($ctx, $msg) = @_;
23 2         7 $dwr->write($msg);
24 6         28 };
25 6         28 [$logger];
26 1         34 }],
27             };
28             }
29              
30             1;
31             # ABSTRACT: Log to Dir::Write::Rotate
32              
33             __END__