| 1 | package Dancer2::Logger::Capture; | ||
| 2 | # ABSTRACT: Capture dancer logs | ||
| 3 | 4 | $Dancer2::Logger::Capture::VERSION = '2.3.0'; | |
| 4 | 14 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 14 | ▶ | use Dancer2::Logger::Capture::Trap; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 4 | with 'Dancer2::Core::Role::Logger'; | |
| 8 | |||
| 9 | 4 | has trapper => ( | |
| 10 | is => 'ro', | ||
| 11 | lazy => 1, | ||
| 12 | builder => '_build_trapper', | ||
| 13 | ); | ||
| 14 | |||
| 15 | 25 | ▶ | sub _build_trapper { Dancer2::Logger::Capture::Trap->new } |
|
Subroutine
_build_trapper: called CC=1 SCAR=0.0
| |||
| 16 | |||
| 17 | 66 | ▶ | sub log { |
|
Subroutine
log: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 18 | 66 | my ( $self, $level, $message ) = @_; | |
| 19 | |||
| 20 | 66 | $self->trapper->store( | |
| 21 | $level, $message, $self->format_message( $level => $message ) | ||
| 22 | ); | ||
| 23 | |||
| 24 | 66 | return; | |
| 25 | } | ||
| 26 | |||
| 27 | 4 | 1; | |
| 28 | |||
| 29 | __END__ | ||