| 1 | package Dancer2::Core::Role::Logger; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | # ABSTRACT: Role for logger engines | ||||||||||||||||||||||||||||||||||||||||||
| 3 | 148 | $Dancer2::Core::Role::Logger::VERSION = '2.2.1'; | |||||||||||||||||||||||||||||||||||||||||
| 4 | 148 | ▶ | use Dancer2::Core::Types; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||
| 6 | 148 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 148 | ▶ | use POSIX 'strftime'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 148 | ▶ | use Encode (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | 148 | ▶ | use Data::Dumper; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | 148 | with 'Dancer2::Core::Role::Engine'; | |||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | 258 | ▶ | sub hook_aliases { +{} } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
hook_aliases: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 14 | sub supported_hooks { | ||||||||||||||||||||||||||||||||||||||||||
| 15 | 62 | ▶ | qw( | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
supported_hooks: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | engine.logger.before | ||||||||||||||||||||||||||||||||||||||||||
| 17 | engine.logger.after | ||||||||||||||||||||||||||||||||||||||||||
| 18 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | ▶ | sub _build_type {'Logger'} | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_type: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | # This is the only method to implement by logger engines. | ||||||||||||||||||||||||||||||||||||||||||
| 24 | # It receives the following arguments: | ||||||||||||||||||||||||||||||||||||||||||
| 25 | # $msg_level, $msg_content, it gets called only if the configuration allows | ||||||||||||||||||||||||||||||||||||||||||
| 26 | # a message of the given level to be logged. | ||||||||||||||||||||||||||||||||||||||||||
| 27 | 148 | requires 'log'; | |||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | 148 | has auto_encoding_charset => ( | |||||||||||||||||||||||||||||||||||||||||
| 30 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||
| 31 | isa => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 32 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||
| 34 | has app_name => ( | ||||||||||||||||||||||||||||||||||||||||||
| 35 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||
| 36 | isa => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 37 | 33 | ▶ | default => sub {'-'}, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 38 | 148 | ); | |||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||
| 40 | has log_format => ( | ||||||||||||||||||||||||||||||||||||||||||
| 41 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||
| 42 | isa => Str, | ||||||||||||||||||||||||||||||||||||||||||
| 43 | 243 | ▶ | default => sub {'[%a:%P] %L @%T> %m in %f l. %l'}, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 44 | 148 | ); | |||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||
| 46 | has caller_stack_size => ( | ||||||||||||||||||||||||||||||||||||||||||
| 47 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||
| 48 | isa => Int, | ||||||||||||||||||||||||||||||||||||||||||
| 49 | 288 | ▶ | default => sub { 9; }, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 50 | 148 | ); | |||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||
| 52 | 148 | my $_levels = { | |||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | # levels < 0 are for core only | ||||||||||||||||||||||||||||||||||||||||||
| 55 | core => -10, | ||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | # levels > 0 are for end-users only | ||||||||||||||||||||||||||||||||||||||||||
| 58 | debug => 1, | ||||||||||||||||||||||||||||||||||||||||||
| 59 | info => 2, | ||||||||||||||||||||||||||||||||||||||||||
| 60 | warn => 3, | ||||||||||||||||||||||||||||||||||||||||||
| 61 | warning => 3, | ||||||||||||||||||||||||||||||||||||||||||
| 62 | error => 4, | ||||||||||||||||||||||||||||||||||||||||||
| 63 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||
| 65 | has log_level => ( | ||||||||||||||||||||||||||||||||||||||||||
| 66 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||
| 67 | 148 | isa => Enum[keys %{$_levels}], | |||||||||||||||||||||||||||||||||||||||||
| 68 | 264 | ▶ | default => sub {'debug'}, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 69 | 148 | ); | |||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||
| 71 | sub _should { | ||||||||||||||||||||||||||||||||||||||||||
| 72 | 3669 | ▶ | my ( $self, $msg_level ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_should: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 73 | 3669 | my $conf_level = $self->log_level; | |||||||||||||||||||||||||||||||||||||||||
| 74 | 3669 | return $_levels->{$conf_level} <= $_levels->{$msg_level}; | |||||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||
| 77 | sub format_message { | ||||||||||||||||||||||||||||||||||||||||||
| 78 | 148 | ▶ | my ( $self, $level, $message ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
format_message: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 79 | 148 | chomp $message; | |||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||
| 81 | 148 | ▶ | $message = Encode::encode( $self->auto_encoding_charset, $message ) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 82 | if $self->auto_encoding_charset; | ||||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||
| 84 | 148 | my $request = $self->request; | |||||||||||||||||||||||||||||||||||||||||
| 85 | 148 | my $config = $self->config; | |||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||
| 87 | my $block_handler = sub { | ||||||||||||||||||||||||||||||||||||||||||
| 88 | 14 | ▶ | my ( $block, $type ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=16.1
| |||||||||||||||||||||||||||||||||||||||||||
| 89 | 14 | ▶ | if ( $type eq 't' ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 90 | 3 | return POSIX::strftime( $block, localtime(time) ); | |||||||||||||||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||||||||||||||
| 92 | elsif ( $type eq 'h' ) { | ||||||||||||||||||||||||||||||||||||||||||
| 93 | 10 | ▶ | return ( $request && $request->header($block) ) || '-'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%5/5
$request && $request->header($block) || '-'
$request and $request->header($block)
MC/DC100%2/2
$request && $request->header($block) || '-'
$request
$request->header($block)
Truth table100%3/3
A and B
A= $requestB= $request->header($block)
| |||||||||||||||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||||||||||||
| 95 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 96 | 1 | Carp::carp("{$block}$type not supported"); | |||||||||||||||||||||||||||||||||||||||||
| 97 | 1 | return "-"; | |||||||||||||||||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||||||||||||||||
| 99 | 148 | }; | |||||||||||||||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||||||||||||||||
| 101 | 148 | my $chars_mapping = $self->map_chars_to_subs($level, $message, ); | |||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||
| 103 | my $char_mapping = sub { | ||||||||||||||||||||||||||||||||||||||||||
| 104 | 703 | ▶ | my $char = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||||||||
| 106 | 703 | my $cb = $chars_mapping->{$char}; | |||||||||||||||||||||||||||||||||||||||||
| 107 | 703 | ▶ | if ( !$cb ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 108 | 6 | Carp::carp "%$char not supported."; | |||||||||||||||||||||||||||||||||||||||||
| 109 | 6 | return "-"; | |||||||||||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||||||||||||
| 111 | 697 | $cb->($char); | |||||||||||||||||||||||||||||||||||||||||
| 112 | 148 | }; | |||||||||||||||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||||||||||||||||
| 114 | 148 | my $fmt = $self->log_format; | |||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||
| 116 | 148 | $fmt =~ s/ | |||||||||||||||||||||||||||||||||||||||||
| 117 | (?: | ||||||||||||||||||||||||||||||||||||||||||
| 118 | \%\{(.+?)\}([a-z])| | ||||||||||||||||||||||||||||||||||||||||||
| 119 | \%([a-zA-Z]) | ||||||||||||||||||||||||||||||||||||||||||
| 120 | ) | ||||||||||||||||||||||||||||||||||||||||||
| 121 | 717 | ▶ | / $1 ? $block_handler->($1, $2) : $char_mapping->($3) /egx; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||
| 123 | 148 | return $fmt . "\n"; | |||||||||||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||
| 126 | sub map_chars_to_subs { | ||||||||||||||||||||||||||||||||||||||||||
| 127 | 148 | ▶ | my ( $self, $level, $message, $caller_delta ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
map_chars_to_subs: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 128 | 148 | ▶ | my @stack = caller($self->caller_stack_size + ($caller_delta // 0)); | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$caller_delta // 0
MC/DC0%0/1
$caller_delta // 0
$caller_delta
Truth table50%1/2
A
A= $caller_delta
| |||||||||||||||||||||||||||||||||||||||||||
| 129 | 148 | my $request = $self->request; | |||||||||||||||||||||||||||||||||||||||||
| 130 | return { | ||||||||||||||||||||||||||||||||||||||||||
| 131 | 96 | ▶ | a => sub { $self->app_name }, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 132 | 2 | ▶ | t => sub { POSIX::strftime( "%d/%b/%Y %H:%M:%S", localtime(time) ) }, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 133 | 94 | ▶ | T => sub { POSIX::strftime( "%Y-%m-%d %H:%M:%S", localtime(time) ) }, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 134 | 2 | ▶ | u => sub { POSIX::strftime( "%d/%b/%Y %H:%M:%S", gmtime(time) ) }, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 135 | 2 | ▶ | U => sub { POSIX::strftime( "%Y-%m-%d %H:%M:%S", gmtime(time) ) }, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 136 | 94 | ▶ | P => sub {$$}, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 137 | 100 | ▶ | L => sub {$level}, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 138 | 103 | ▶ | m => sub {$message}, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 139 | 3 | ▶ | p => sub { $stack[0] || '-' }, # package | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 140 | 95 | ▶ | f => sub { $stack[1] || '-' }, # filepath | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 141 | 95 | ▶ | l => sub { $stack[2] || '-' }, # line number | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 142 | h => sub { | ||||||||||||||||||||||||||||||||||||||||||
| 143 | 3 | ▶ | ( $request && ( $request->remote_host || $request->address ) ) || '-' | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=4 SCAR=15.2
Branch: 1 branch
Condition50%3/6
$request and $request->remote_host || $request->address
$request->remote_host or $request->address
MC/DC33%1/3
$request and $request->remote_host || $request->address
$request
$request->remote_host
$request->address
Truth table50%2/4
A and B or C
A= $requestB= $request->remote_hostC= $request->address
| |||||||||||||||||||||||||||||||||||||||||||
| 144 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 145 | 8 | ▶ | i => sub { ( $request && $request->id ) || '-' }, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.1
Branch: 1 branch
Condition66%2/3
$request and $request->id
MC/DC50%1/2
$request and $request->id
$request
$request->id
Truth table66%2/3
A and B
A= $requestB= $request->id
| |||||||||||||||||||||||||||||||||||||||||||
| 146 | 148 | }; | |||||||||||||||||||||||||||||||||||||||||
| 147 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||
| 149 | sub _serialize { | ||||||||||||||||||||||||||||||||||||||||||
| 150 | 121 | ▶ | my @vars = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_serialize: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||||||||||||
| 152 | 121 | ▶ | return join q{}, map +( | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 153 | ref $_ | ||||||||||||||||||||||||||||||||||||||||||
| 154 | ? Data::Dumper->new( [$_] )->Terse(1)->Purity(1)->Indent(0) | ||||||||||||||||||||||||||||||||||||||||||
| 155 | ->Sortkeys(1)->Dump() | ||||||||||||||||||||||||||||||||||||||||||
| 156 | : ( defined($_) ? $_ : 'undef' ) | ||||||||||||||||||||||||||||||||||||||||||
| 157 | ), @vars; | ||||||||||||||||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||||||||||
| 160 | around 'log' => sub { | ||||||||||||||||||||||||||||||||||||||||||
| 161 | 129 | ▶ | my ($orig, $self, @args) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||||||||||||||
| 163 | 129 | $self->execute_hook( 'engine.logger.before', $self, @args ); | |||||||||||||||||||||||||||||||||||||||||
| 164 | 129 | $self->$orig( @args ); | |||||||||||||||||||||||||||||||||||||||||
| 165 | 129 | $self->execute_hook( 'engine.logger.after', $self, @args ); | |||||||||||||||||||||||||||||||||||||||||
| 166 | 148 | }; | |||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||
| 168 | sub core { | ||||||||||||||||||||||||||||||||||||||||||
| 169 | 3537 | ▶ | my ( $self, @args ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
core: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 170 | 3537 | ▶ | $self->_should('core') and $self->log( 'core', _serialize(@args) ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||||||||||
| 173 | sub debug { | ||||||||||||||||||||||||||||||||||||||||||
| 174 | 37 | ▶ | my ( $self, @args ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
debug: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 175 | 37 | ▶ | $self->_should('debug') and $self->log( 'debug', _serialize(@args) ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||||||||||
| 178 | sub info { | ||||||||||||||||||||||||||||||||||||||||||
| 179 | 20 | ▶ | my ( $self, @args ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
info: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 180 | 20 | ▶ | $self->_should('info') and $self->log( 'info', _serialize(@args) ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 181 | } | ||||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||
| 183 | sub warning { | ||||||||||||||||||||||||||||||||||||||||||
| 184 | 20 | ▶ | my ( $self, @args ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
warning: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 185 | 20 | ▶ | $self->_should('warning') and $self->log( 'warning', _serialize(@args) ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 186 | } | ||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||
| 188 | sub error { | ||||||||||||||||||||||||||||||||||||||||||
| 189 | 55 | ▶ | my ( $self, @args ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
error: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 190 | 55 | ▶ | $self->_should('error') and $self->log( 'error', _serialize(@args) ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 191 | } | ||||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||
| 193 | 148 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||||||||||||||||
| 195 | __END__ | ||||||||||||||||||||||||||||||||||||||||||