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.009'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
39020
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
6
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
23
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
3
|
use Log::Any::Adapter::Util (); |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
13
|
|
9
|
1
|
|
|
1
|
|
472
|
use parent qw(Log::Any::Adapter::Base); |
|
1
|
|
|
|
|
248
|
|
|
1
|
|
|
|
|
5
|
|
10
|
1
|
|
|
1
|
|
1734
|
use Log::Handler; |
|
1
|
|
|
|
|
40297
|
|
|
1
|
|
|
|
|
8
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub init { |
13
|
1
|
|
|
1
|
0
|
3043
|
my $self = shift; |
14
|
1
|
|
33
|
|
|
12
|
$self->{logger} ||= Log::Handler->new; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# logging methods |
18
|
|
|
|
|
|
|
foreach my $method (Log::Any::Adapter::Util::logging_methods) { |
19
|
1
|
|
|
1
|
|
79
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
82
|
|
20
|
|
|
|
|
|
|
my $handler_method = $method; |
21
|
|
|
|
|
|
|
*$method = sub { |
22
|
14
|
|
|
14
|
|
3446
|
my $self = shift; |
23
|
14
|
|
|
|
|
67
|
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
|
|
4
|
no strict 'refs'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
55
|
|
32
|
|
|
|
|
|
|
*$method = sub { |
33
|
7
|
|
|
7
|
|
2060
|
my $self = shift; |
34
|
7
|
|
|
|
|
47
|
return $self->{logger}->$handler_method(@_); |
35
|
|
|
|
|
|
|
}; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |