| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Dancer2::Logger::Capture; |
|
2
|
|
|
|
|
|
|
# ABSTRACT: Capture dancer logs |
|
3
|
|
|
|
|
|
|
$Dancer2::Logger::Capture::VERSION = '2.1.0'; |
|
4
|
11
|
|
|
11
|
|
533913
|
use Moo; |
|
|
11
|
|
|
|
|
17712
|
|
|
|
11
|
|
|
|
|
86
|
|
|
5
|
11
|
|
|
11
|
|
13414
|
use Dancer2::Logger::Capture::Trap; |
|
|
11
|
|
|
|
|
360
|
|
|
|
11
|
|
|
|
|
1926
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
with 'Dancer2::Core::Role::Logger'; |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has trapper => ( |
|
10
|
|
|
|
|
|
|
is => 'ro', |
|
11
|
|
|
|
|
|
|
lazy => 1, |
|
12
|
|
|
|
|
|
|
builder => '_build_trapper', |
|
13
|
|
|
|
|
|
|
); |
|
14
|
|
|
|
|
|
|
|
|
15
|
9
|
|
|
9
|
|
211
|
sub _build_trapper { Dancer2::Logger::Capture::Trap->new } |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub log { |
|
18
|
|
|
|
|
|
|
my ( $self, $level, $message ) = @_; |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$self->trapper->store( |
|
21
|
|
|
|
|
|
|
$level, $message, $self->format_message( $level => $message ) |
|
22
|
|
|
|
|
|
|
); |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
return; |
|
25
|
|
|
|
|
|
|
} |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__END__ |