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.011'; |
4
|
6
|
|
|
6
|
|
411345
|
use strict; |
|
6
|
|
|
|
|
60
|
|
|
6
|
|
|
|
|
190
|
|
5
|
6
|
|
|
6
|
|
27
|
use warnings; |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
187
|
|
6
|
|
|
|
|
|
|
|
7
|
6
|
|
|
6
|
|
2353
|
use Log::Any 1.00; |
|
6
|
|
|
|
|
58663
|
|
|
6
|
|
|
|
|
27
|
|
8
|
6
|
|
|
6
|
|
2929
|
use Log::Any::Plugin::Util qw( get_class_name ); |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
276
|
|
9
|
|
|
|
|
|
|
|
10
|
6
|
|
|
6
|
|
2490
|
use Class::Load qw( try_load_class ); |
|
6
|
|
|
|
|
93560
|
|
|
6
|
|
|
|
|
342
|
|
11
|
6
|
|
|
6
|
|
44
|
use Carp qw( croak ); |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
1029
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub add { |
14
|
9
|
|
|
9
|
1
|
19754
|
my ($class, $plugin_class, %plugin_args) = @_; |
15
|
|
|
|
|
|
|
|
16
|
9
|
|
|
|
|
33
|
my $adapter_class = ref Log::Any->get_logger(category => caller()); |
17
|
|
|
|
|
|
|
|
18
|
9
|
|
|
|
|
1054
|
$plugin_class = get_class_name($plugin_class); |
19
|
|
|
|
|
|
|
|
20
|
9
|
|
|
|
|
39
|
my ($loaded, $error) = try_load_class($plugin_class); |
21
|
9
|
50
|
|
|
|
393
|
die $error unless $loaded; |
22
|
|
|
|
|
|
|
|
23
|
9
|
|
|
|
|
50
|
$plugin_class->install($adapter_class, %plugin_args); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |