line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Dancer::Logger::Capture::Trap; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:SUKRIA'; |
3
|
|
|
|
|
|
|
$Dancer::Logger::Capture::Trap::VERSION = '1.3514_04'; # TRIAL |
4
|
|
|
|
|
|
|
$Dancer::Logger::Capture::Trap::VERSION = '1.351404'; |
5
|
|
|
|
|
|
|
# ABSTRACT: a place to store captured Dancer logs |
6
|
87
|
|
|
87
|
|
1046
|
use strict; |
|
87
|
|
|
|
|
183
|
|
|
87
|
|
|
|
|
2508
|
|
7
|
87
|
|
|
87
|
|
410
|
use warnings; |
|
87
|
|
|
|
|
174
|
|
|
87
|
|
|
|
|
2245
|
|
8
|
87
|
|
|
87
|
|
451
|
use base 'Dancer::Object'; |
|
87
|
|
|
|
|
163
|
|
|
87
|
|
|
|
|
19148
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
__PACKAGE__->attributes( "_storage" ); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub init { |
14
|
87
|
|
|
87
|
1
|
189
|
my $self = shift; |
15
|
87
|
50
|
|
|
|
271
|
$self->_storage([]) unless $self->_storage; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub store { |
19
|
39
|
|
|
39
|
1
|
85
|
my($self, $level, $message) = @_; |
20
|
|
|
|
|
|
|
|
21
|
39
|
|
|
|
|
61
|
push @{$self->_storage}, { level => $level, message => $message }; |
|
39
|
|
|
|
|
107
|
|
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub read { |
27
|
4
|
|
|
4
|
1
|
9
|
my $self = shift; |
28
|
|
|
|
|
|
|
|
29
|
4
|
|
|
|
|
9
|
my $logs = $self->_storage; |
30
|
4
|
|
|
|
|
13
|
$self->_storage([]); |
31
|
4
|
|
|
|
|
24
|
return $logs; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |