line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBIx::Class::DeploymentHandler::LogRouter; |
2
|
|
|
|
|
|
|
$DBIx::Class::DeploymentHandler::LogRouter::VERSION = '0.002233'; |
3
|
20
|
|
|
20
|
|
8931
|
use Moo; |
|
20
|
|
|
|
|
224011
|
|
|
20
|
|
|
|
|
89
|
|
4
|
20
|
|
|
20
|
|
89113
|
use DBIx::Class::DeploymentHandler::Logger; |
|
20
|
|
|
|
|
52
|
|
|
20
|
|
|
|
|
3197
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
with 'Log::Contextual::Role::Router'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has _logger => ( |
9
|
|
|
|
|
|
|
is => 'lazy', |
10
|
19
|
|
|
19
|
|
551
|
builder => sub { DBIx::Class::DeploymentHandler::Logger->new }, |
11
|
|
|
|
|
|
|
); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub handle_log_request { |
14
|
409
|
|
|
409
|
0
|
7431
|
my ($self, %message_info) = @_; |
15
|
|
|
|
|
|
|
|
16
|
409
|
|
|
|
|
1001
|
my $log_code_block = $message_info{message_sub}; |
17
|
409
|
|
|
|
|
817
|
my $args = $message_info{message_args}; |
18
|
409
|
|
|
|
|
748
|
my $log_level_name = $message_info{message_level}; |
19
|
409
|
|
|
|
|
7909
|
my $logger = $self->_logger; |
20
|
409
|
|
|
|
|
5472
|
my $is_active = $logger->can("is_${log_level_name}"); |
21
|
|
|
|
|
|
|
|
22
|
409
|
50
|
33
|
|
|
2399
|
return unless defined $is_active && $logger->$is_active; |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
my $log_message = $log_code_block->(@$args); |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
$self->_logger->$log_level_name($log_message); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
44
|
0
|
|
sub before_import {} |
30
|
|
|
|
44
|
0
|
|
sub after_import {} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |