Stepford/LoggerWithMoniker.pm

filter: Statementstmt 100% 27 / 27 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 33 / 33 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Stepford/Error.pm ↑ Summary Stepford/Role/Step/Unserializable.pm »
1 package Stepford::LoggerWithMoniker;
2  
3 43 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 43 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 43 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 43 our $VERSION = '0.006001';
8  
9 43 ▶use Stepford::Types qw( Logger Str );
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 43 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 43 my $Levels = [qw( debug info notice warning error )];
14  
15 43 has _logger => (
16 is => 'ro',
17 isa => Logger,
18 init_arg => 'logger',
19 required => 1,
20 handles => $Levels,
21 );
22  
23 43 has _moniker => (
24 is => 'ro',
25 isa => Str,
26 init_arg => 'moniker',
27 required => 1,
28 );
29  
30 81 ▶around $Levels => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
31 81 my $orig = shift;
32 81 my $self = shift;
33 81 my $message = shift;
34  
35 81 $message = '[' . $self->_moniker . '] ' . $message;
36  
37 81 return $self->$orig( $message, @_ );
38 43 };
39  
40 43 __PACKAGE__->meta->make_immutable;
41  
42 43 1;
43  
44 # ABSTRACT: The logger used by Step classes.
45  
46 __END__
« Stepford/Error.pm ↑ Summary Stepford/Role/Step/Unserializable.pm »