File Coverage

blib/lib/Log/ger/Filter/Code.pm
Criterion Covered Total %
statement 6 12 50.0
branch 0 2 0.0
condition n/a
subroutine 2 5 40.0
pod 0 2 0.0
total 8 21 38.1


line stmt bran cond sub pod time code
1             package Log::ger::Filter::Code;
2              
3 1     1   417792 use strict;
  1         1  
  1         35  
4 1     1   3 use warnings;
  1         1  
  1         222  
5              
6             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
7             our $DATE = '2023-12-29'; # DATE
8             our $DIST = 'Log-ger'; # DIST
9             our $VERSION = '0.042'; # VERSION
10              
11             sub meta { +{
12 0     0 0   v => 1,
13             } }
14              
15             sub get_hooks {
16 0     0 0   my %conf = @_;
17              
18 0 0         $conf{code} or die "Please specify code";
19              
20             return {
21             create_filter => [
22             __PACKAGE__, # key
23             50, # priority
24             sub { # hook
25 0     0     my %hook_args = @_; # see Log::ger::Manual::Internals/"Arguments passed to hook"
26              
27 0           [$conf{code}];
28 0           }],
29             };
30             }
31              
32             1;
33             # ABSTRACT: Filter using a coderef
34              
35             __END__