File Coverage

blib/lib/Log/ger/Format/Flogger.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 0 2 0.0
total 21 23 91.3


line stmt bran cond sub pod time code
1             package Log::ger::Format::Flogger;
2              
3             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
4             our $DATE = '2020-03-09'; # DATE
5             our $DIST = 'Log-ger-Format-Flogger'; # DIST
6             our $VERSION = '0.004'; # VERSION
7              
8 1     1   66412 use strict;
  1         10  
  1         24  
9 1     1   4 use warnings;
  1         2  
  1         23  
10              
11 1     1   348 use String::Flogger qw(flog);
  1         14081  
  1         6  
12              
13             sub meta { +{
14 1     1 0 16 v => 1,
15             } }
16              
17             sub get_hooks {
18 1     1 0 14 my %plugin_conf = @_;
19              
20             return {
21             create_formatter => [
22             __PACKAGE__, # key
23             50, # priority
24             sub { # hook
25 2     2   2121 my %hook_args = @_; # see Log::ger::Manual::Internals/"Arguments passed to hook"
26              
27 2         3 my $formatter = \&flog;
28 2         6 [$formatter];
29 1         7 }],
30             };
31             }
32              
33             1;
34             # ABSTRACT: Use String::Flogger for formatting instead of sprintf
35              
36             __END__