ger/Filter/Code.pm

filter: Statementstmt 64.7% 11 / 17 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 40.0% 2 / 5 Podpod 0.0% 0 / 2 totaltotal 50.0% 13 / 26 CC 2 SCAR 11.0
CC
2
Cov
58%
get_hooks
6.0
meta
2.0
__ANON__
2.0
CRAP 3.0
« ger/Format/MultilevelLog.pm ↑ Summary ger/Output/String.pm »
1 package Log::ger::Filter::Code;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
7 1 our $DATE = '2023-12-29'; # DATE
8 1 our $DIST = 'Log-ger'; # DIST
9 1 our $VERSION = '0.042'; # VERSION
10  
11 0 ▶sub meta { +{
Subroutine meta: not called CC=1 SCAR=6.9
Pod undocumented
12 0 v => 1,
13 } }
14  
15 0 ▶sub get_hooks {
Subroutine get_hooks: not called CC=2 SCAR=17.9
Pod undocumented
16 0 my %conf = @_;
17  
18 0 ▶ $conf{code} or die "Please specify code";
Branch: 1 branch
BranchTrueFalseTotal
$conf{"code"} or die "Please specify code" 0 0 0
19  
20 return {
21 create_filter => [
22 __PACKAGE__, # key
23 50, # priority
24 0 ▶ sub { # hook
Subroutine __ANON__: not called CC=1 SCAR=6.9
25 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 1;
33 # ABSTRACT: Filter using a coderef
34  
35 __END__
« ger/Format/MultilevelLog.pm ↑ Summary ger/Output/String.pm »