| 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
| |||||||||||
| 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__ | ||||||||||