line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Log::Any::Adapter::Handler; |
2
|
|
|
|
|
|
|
# ABSTRACT: Log::Any::Adapter for Log::Handler |
3
|
|
|
|
|
|
|
our $VERSION = '0.008'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
29114
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
6
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
23
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
4
|
use Log::Any::Adapter::Util (); |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
14
|
|
9
|
1
|
|
|
1
|
|
475
|
use parent qw(Log::Any::Adapter::Base); |
|
1
|
|
|
|
|
265
|
|
|
1
|
|
|
|
|
5
|
|
10
|
1
|
|
|
1
|
|
1752
|
use Log::Handler; |
|
1
|
|
|
|
|
37825
|
|
|
1
|
|
|
|
|
10
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub init { |
13
|
1
|
|
|
1
|
0
|
4054
|
my $self = shift; |
14
|
1
|
|
33
|
|
|
14
|
$self->{logger} ||= Log::Handler->new; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# logging methods |
18
|
|
|
|
|
|
|
foreach my $method (Log::Any::Adapter::Util::logging_methods) { |
19
|
1
|
|
|
1
|
|
111
|
no strict 'refs'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
126
|
|
20
|
|
|
|
|
|
|
my $handler_method = $method; |
21
|
|
|
|
|
|
|
*$method = sub { |
22
|
14
|
|
|
14
|
|
4784
|
my $self = shift; |
23
|
14
|
|
|
|
|
78
|
return $self->{logger}->$handler_method(@_); |
24
|
|
|
|
|
|
|
}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# detection methods |
28
|
|
|
|
|
|
|
foreach my $method (Log::Any::Adapter::Util::detection_methods()) { |
29
|
|
|
|
|
|
|
my $self = shift; |
30
|
|
|
|
|
|
|
my $handler_method = $method; |
31
|
1
|
|
|
1
|
|
7
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
99
|
|
32
|
|
|
|
|
|
|
*$method = sub { |
33
|
7
|
|
|
7
|
|
2536
|
my $self = shift; |
34
|
7
|
|
|
|
|
57
|
return $self->{logger}->$handler_method(@_); |
35
|
|
|
|
|
|
|
}; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |