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 CC 2 SCAR 2.7
CC
2
Cov
96%
init
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« lib/Dancer/Continuation/Route.pm ↑ Summary lib/Dancer/Template.pm »
1 package Dancer::Logger::Capture::Trap;
2 88 our $AUTHORITY = 'cpan:SUKRIA';
3 88 $Dancer::Logger::Capture::Trap::VERSION = '1.3522';
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 87 ▶sub init {
Subroutine init: called CC=2 SCAR=7.2
Pod documented
13 87 my $self = shift;
14 87 ▶ $self->_storage([]) unless $self->_storage;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->_storage 87 0 87
15 }
16  
17 39 ▶sub store {
Subroutine store: called CC=1 SCAR=0.0
Pod documented
18 39 my($self, $level, $message) = @_;
19  
20 39 push @{$self->_storage}, { level => $level, message => $message };
21 }
22  
23  
24  
25 4 ▶sub read {
Subroutine read: called CC=1 SCAR=0.0
Pod documented
26 4 my $self = shift;
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__
« lib/Dancer/Continuation/Route.pm ↑ Summary lib/Dancer/Template.pm »