line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Log::Any::Plugin; |
2
|
|
|
|
|
|
|
# ABSTRACT: Adapter-modifying plugins for Log::Any |
3
|
|
|
|
|
|
|
$Log::Any::Plugin::VERSION = '0.007'; |
4
|
2
|
|
|
2
|
|
48377
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
46
|
|
5
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
46
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
695
|
use Log::Any 1.00; |
|
2
|
|
|
|
|
13744
|
|
|
2
|
|
|
|
|
9
|
|
8
|
2
|
|
|
2
|
|
732
|
use Log::Any::Plugin::Util qw( get_class_name ); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
88
|
|
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
712
|
use Class::Load qw( try_load_class ); |
|
2
|
|
|
|
|
26968
|
|
|
2
|
|
|
|
|
98
|
|
11
|
2
|
|
|
2
|
|
13
|
use Carp qw( croak ); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
201
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub add { |
14
|
5
|
|
|
5
|
1
|
6366
|
my ($class, $plugin_class, %plugin_args) = @_; |
15
|
|
|
|
|
|
|
|
16
|
5
|
|
|
|
|
17
|
my $adapter_class = ref Log::Any->get_logger(category => caller()); |
17
|
|
|
|
|
|
|
|
18
|
5
|
|
|
|
|
494
|
$plugin_class = get_class_name($plugin_class); |
19
|
|
|
|
|
|
|
|
20
|
5
|
|
|
|
|
20
|
my ($loaded, $error) = try_load_class($plugin_class); |
21
|
5
|
50
|
|
|
|
258
|
die $error unless $loaded; |
22
|
|
|
|
|
|
|
|
23
|
5
|
|
|
|
|
23
|
$plugin_class->install($adapter_class, %plugin_args); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |