line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBIx::Class::DeploymentHandler::Logger; |
2
|
|
|
|
|
|
|
$DBIx::Class::DeploymentHandler::Logger::VERSION = '0.002233'; |
3
|
20
|
|
|
20
|
|
127
|
use warnings; |
|
20
|
|
|
|
|
40
|
|
|
20
|
|
|
|
|
634
|
|
4
|
20
|
|
|
20
|
|
99
|
use strict; |
|
20
|
|
|
|
|
42
|
|
|
20
|
|
|
|
|
377
|
|
5
|
|
|
|
|
|
|
|
6
|
20
|
|
|
20
|
|
83
|
use parent 'Log::Contextual::WarnLogger'; |
|
20
|
|
|
|
|
38
|
|
|
20
|
|
|
|
|
140
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# trace works the way we want it already |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# sub is_trace { $_[0]->next::method } |
11
|
284
|
50
|
|
284
|
1
|
1115
|
sub is_debug { $_[0]->is_trace || $_[0]->next::method } |
12
|
173
|
50
|
|
173
|
1
|
682
|
sub is_info { $_[0]->is_debug || $_[0]->next::method } |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub is_warn { |
15
|
0
|
|
|
0
|
1
|
0
|
my $orig = $_[0]->next::method; |
16
|
0
|
0
|
0
|
|
|
0
|
return undef if defined $orig && !$orig; |
17
|
0
|
|
0
|
|
|
0
|
return $_[0]->is_info || 1 |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub is_error { |
21
|
0
|
|
|
0
|
1
|
0
|
my $orig = $_[0]->next::method; |
22
|
0
|
0
|
0
|
|
|
0
|
return undef if defined $orig && !$orig; |
23
|
0
|
|
0
|
|
|
0
|
return $_[0]->is_warn || 1 |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub is_fatal { |
27
|
0
|
|
|
0
|
1
|
0
|
my $orig = $_[0]->next::method; |
28
|
0
|
0
|
0
|
|
|
0
|
return undef if defined $orig && !$orig; |
29
|
0
|
|
0
|
|
|
0
|
return $_[0]->is_error || 1 |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub _log { |
33
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
34
|
0
|
|
|
|
|
0
|
my $level = shift; |
35
|
0
|
|
|
|
|
0
|
my $message = join( "\n", @_ ); |
36
|
0
|
0
|
|
|
|
0
|
$message .= "\n" unless $message =~ /\n$/; |
37
|
0
|
|
|
|
|
0
|
warn "[DBICDH] [$level] $message"; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub new { |
41
|
19
|
|
|
19
|
1
|
73
|
my ($self, $options, @rest) = @_; |
42
|
|
|
|
|
|
|
|
43
|
19
|
|
50
|
|
|
137
|
$options ||= {}; |
44
|
19
|
|
50
|
|
|
190
|
$options->{env_prefix} ||= 'DBICDH'; |
45
|
|
|
|
|
|
|
|
46
|
19
|
|
|
|
|
96
|
$self->next::method($options, @rest) |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |