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

filter: Statementstmt 100% 22 / 22 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 3 / 3 totaltotal 96.9% 32 / 33 SCAR 6.9
CC
2
Cov
96%
init
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« blib/lib/Dancer/Template.pm ↑ Summary blib/lib/Dancer/Continuation.pm »
1 package Dancer::Logger::Capture::Trap;
2 88 our $AUTHORITY = 'cpan:SUKRIA';
3 88 $Dancer::Logger::Capture::Trap::VERSION = '1.3520';
4 # ABSTRACT: a place to store captured Dancer logs
5 88 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 88 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 88 ▶use base 'Dancer::Object';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9  
10 88 __PACKAGE__->attributes( "_storage" );
11  
12 sub init {
13 87 ▶ my $self = shift;
Subroutine init: called CC=2 SCAR=7.2
Pod documented
14 87 ▶ $self->_storage([]) unless $self->_storage;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->_storage 87 0 87
15 }
16  
17 sub store {
18 39 ▶ my($self, $level, $message) = @_;
Subroutine store: called CC=1 SCAR=0.0
Pod documented
19  
20 39 push @{$self->_storage}, { level => $level, message => $message };
21 }
22  
23  
24  
25 sub read {
26 4 ▶ my $self = shift;
Subroutine read: called CC=1 SCAR=0.0
Pod documented
27  
28 4 my $logs = $self->_storage;
29 4 $self->_storage([]);
30 4 return $logs;
31 }
32  
33  
34  
35 88 1;
36  
37 __END__
« blib/lib/Dancer/Template.pm ↑ Summary blib/lib/Dancer/Continuation.pm »