Plugin.pm

filter: Statementstmt 100% 26 / 26 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 97.2% 35 / 36 CC 2 SCAR 2.2
CC
2
Cov
96%
add
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Plugin/ContextStack.pm ↑ Summary Plugin/Util.pm »
1 package Log::Any::Plugin;
2 # ABSTRACT: Adapter-modifying plugins for Log::Any
3 8 $Log::Any::Plugin::VERSION = '0.012';
4 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 8 ▶use Log::Any 1.00;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 8 ▶use Log::Any::Plugin::Util qw( get_class_name );
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 8 ▶use Class::Load qw( try_load_class );
Subroutine BEGIN: called CC=1 SCAR=0.0
11 8 ▶use Carp qw( croak );
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 10 ▶sub add {
Subroutine add: called CC=2 SCAR=7.0
Pod documented
14 10 my ($class, $plugin_class, %plugin_args) = @_;
15  
16 10 my $adapter_class = ref Log::Any->get_logger(category => caller());
17  
18 10 $plugin_class = get_class_name($plugin_class);
19  
20 10 my ($loaded, $error) = try_load_class($plugin_class);
21 10 ▶ die $error unless $loaded;
Branch: 1 branch
BranchTrueFalseTotal
unless $loaded 0 10 10
22  
23 10 $plugin_class->install($adapter_class, %plugin_args);
24 }
25  
26 8 1;
27  
28 __END__
« Plugin/ContextStack.pm ↑ Summary Plugin/Util.pm »