| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Dancer2::Logger::Capture; |
|
2
|
|
|
|
|
|
|
# ABSTRACT: Capture dancer logs |
|
3
|
|
|
|
|
|
|
$Dancer2::Logger::Capture::VERSION = '2.0.1'; |
|
4
|
11
|
|
|
11
|
|
582792
|
use Moo; |
|
|
11
|
|
|
|
|
17131
|
|
|
|
11
|
|
|
|
|
92
|
|
|
5
|
11
|
|
|
11
|
|
14155
|
use Dancer2::Logger::Capture::Trap; |
|
|
11
|
|
|
|
|
49
|
|
|
|
11
|
|
|
|
|
1806
|
|
|
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
|
|
260
|
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__ |