File Coverage

blib/lib/Log/ger/Format/Join.pm
Criterion Covered Total %
statement 13 13 100.0
branch 2 2 100.0
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 19 20 95.0


line stmt bran cond sub pod time code
1             package Log::ger::Format::Join;
2              
3             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
4             our $DATE = '2020-02-18'; # DATE
5             our $DIST = 'Log-ger-Format-Join'; # DIST
6             our $VERSION = '0.001'; # VERSION
7              
8 1     1   83458 use strict;
  1         9  
  1         30  
9 1     1   5 use warnings;
  1         2  
  1         155  
10              
11             sub get_hooks {
12 2     2 0 1355 my %conf = @_;
13              
14 2 100       7 my $with = $conf{with} ? $conf{with} : '';
15              
16             return {
17             create_formatter => [
18             __PACKAGE__, # key
19             50, # priority
20             sub { # hook
21 4     4   2774 my %hook_args = @_; # see Log::ger::Manual::Internals/"Arguments passed to hook"
22              
23 4         12 my $formatter = sub { join $with, @_ };
  2         1378  
24 4         12 [$formatter];
25 2         15 }],
26             };
27             }
28              
29             1;
30             # ABSTRACT: Join arguments together as string
31              
32             __END__