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   1659 use warnings;
  1         3  
  1         26  
6 1     1   4 use strict;
  1         2  
  1         26  
7              
8             package Log::Report::Dispatcher::Callback;
9 1     1   3 use vars '$VERSION';
  1         2  
  1         36  
10             $VERSION = '1.22';
11              
12 1     1   5 use base 'Log::Report::Dispatcher';
  1         2  
  1         89  
13              
14 1     1   5 use Log::Report 'log-report';
  1         2  
  1         4  
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;