File Coverage

blib/lib/Log/Report/Dispatcher/Callback.pm
Criterion Covered Total %
statement 15 22 68.1
branch 0 2 0.0
condition n/a
subroutine 5 8 62.5
pod 2 3 66.6
total 22 35 62.8


line stmt bran cond sub pod time code
1             # Copyrights 2007-2017 by [Mark Overmeer].
2             # For other contributors see ChangeLog.
3             # See the manual pages for details on the licensing terms.
4             # Pod stripped from pm file by OODoc 2.02.
5 1     1   1667 use warnings;
  1         2  
  1         128  
6 1     1   10 use strict;
  1         2  
  1         84  
7              
8             package Log::Report::Dispatcher::Callback;
9 1     1   7 use vars '$VERSION';
  1         1  
  1         96  
10             $VERSION = '1.23';
11              
12 1     1   6 use base 'Log::Report::Dispatcher';
  1         3  
  1         178  
13              
14 1     1   7 use Log::Report 'log-report';
  1         31  
  1         8  
15              
16              
17             sub init($)
18 0     0 0   { my ($self, $args) = @_;
19 0           $self->SUPER::init($args);
20              
21             $self->{callback} = $args->{callback}
22 0 0         or error __x"dispatcher {name} needs a 'callback'", name => $self->name;
23              
24 0           $self;
25             }
26              
27              
28 0     0 1   sub callback() {shift->{callback}}
29              
30              
31             sub log($$$$)
32 0     0 1   { my $self = shift;
33 0           $self->{callback}->($self, @_);
34             }
35              
36             1;