| 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
| |||||||||||
| 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__ | ||||||||||