blib/lib/Dancer2/Logger/Capture/Trap.pm

filter: Statementstmt 100% 17 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 2 / 2 totaltotal 100% 24 / 24 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
__ANON__
1.0
CRAP 1.0
« blib/lib/Dancer2/Serializer/YAML.pm ↑ Summary blib/lib/Dancer2/Logger/Diag.pm »
1 package Dancer2::Logger::Capture::Trap;
2 # ABSTRACT: a place to store captured Dancer2 logs
3 15 $Dancer2::Logger::Capture::Trap::VERSION = '2.3.0';
4 15 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 15 ▶use Dancer2::Core::Types;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 has storage => (
8 is => 'rw',
9 isa => ArrayRef,
10 25 ▶ default => sub { [] },
Subroutine __ANON__: called CC=1 SCAR=0.0
11 15 );
12  
13 66 ▶sub store {
Subroutine store: called CC=1 SCAR=0.0
Pod documented
14 66 my ( $self, $level, $message, $fmt_string ) = @_;
15 66 push @{ $self->storage }, {
16 level => $level,
17 message => $message,
18 formatted => $fmt_string,
19 };
20 }
21  
22 28 ▶sub read {
Subroutine read: called CC=1 SCAR=0.0
Pod documented
23 28 my $self = shift;
24  
25 28 my $logs = $self->storage;
26 28 $self->storage( [] );
27 28 return $logs;
28 }
29  
30 15 1;
31  
32 __END__
« blib/lib/Dancer2/Serializer/YAML.pm ↑ Summary blib/lib/Dancer2/Logger/Diag.pm »