line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Log::Dispatch::Configurator::YAML; |
2
|
3
|
|
|
3
|
|
188068
|
use base 'Log::Dispatch::Configurator'; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
4532
|
|
3
|
3
|
|
|
3
|
|
1962
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
85
|
|
4
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
11
|
|
|
3
|
|
|
|
|
136
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
2788
|
use YAML (); |
|
3
|
|
|
|
|
45084
|
|
|
3
|
|
|
|
|
1000
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
2
|
|
|
2
|
0
|
35
|
my($class, $file) = @_; |
13
|
2
|
|
|
|
|
12
|
my $self = bless { file => $file }, $class; |
14
|
2
|
|
|
|
|
10
|
$self->parse_file; |
15
|
2
|
|
|
|
|
14
|
return $self; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub parse_file { |
20
|
2
|
|
|
2
|
0
|
5
|
my $self = shift; |
21
|
2
|
|
|
|
|
18
|
my $file = $self->{'file'}; |
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
|
|
11
|
my $config = YAML::LoadFile($file); |
24
|
2
|
|
|
|
|
65629
|
$self->{'_config'} = $config; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub reload { |
29
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
30
|
0
|
|
|
|
|
0
|
$self->parse_file; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub get_attrs_global { |
35
|
2
|
|
|
2
|
0
|
389
|
my $self = shift; |
36
|
2
|
50
|
|
|
|
14
|
my $dispatchers |
37
|
|
|
|
|
|
|
= exists $self->{'_config'}->{'dispatchers'} ? $self->{'_config'}->{'dispatchers'} : []; |
38
|
|
|
|
|
|
|
return { |
39
|
2
|
|
|
|
|
12
|
format => undef, |
40
|
|
|
|
|
|
|
dispatchers => $dispatchers, |
41
|
|
|
|
|
|
|
}; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub get_attrs { |
46
|
4
|
|
|
4
|
0
|
10018
|
my($self, $name) = @_; |
47
|
4
|
|
|
|
|
30
|
return $self->{'_config'}->{$name}; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |