| 1 | package Log::Dispatch::Configurator::YAML; | ||||||||||
| 2 | 3 | ▶ | use base 'Log::Dispatch::Configurator'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 3 | our $VERSION = '0.03'; | |||||||||
| 7 | |||||||||||
| 8 | 3 | ▶ | use YAML (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | |||||||||||
| 11 | 2 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 12 | 2 | my($class, $file) = @_; | |||||||||
| 13 | 2 | my $self = bless { file => $file }, $class; | |||||||||
| 14 | 2 | $self->parse_file; | |||||||||
| 15 | 2 | return $self; | |||||||||
| 16 | } | ||||||||||
| 17 | |||||||||||
| 18 | |||||||||||
| 19 | 2 | ▶ | sub parse_file { | ||||||||
|
Subroutine
parse_file: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 20 | 2 | my $self = shift; | |||||||||
| 21 | 2 | my $file = $self->{'file'}; | |||||||||
| 22 | |||||||||||
| 23 | 2 | my $config = YAML::LoadFile($file); | |||||||||
| 24 | 2 | $self->{'_config'} = $config; | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | |||||||||||
| 28 | 0 | ▶ | sub reload { | ||||||||
|
Subroutine
reload: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 29 | 0 | my $self = shift; | |||||||||
| 30 | 0 | $self->parse_file; | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | |||||||||||
| 34 | 2 | ▶ | sub get_attrs_global { | ||||||||
|
Subroutine
get_attrs_global: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||
| 35 | 2 | my $self = shift; | |||||||||
| 36 | my $dispatchers | ||||||||||
| 37 | 2 | ▶ | = exists $self->{'_config'}->{'dispatchers'} ? $self->{'_config'}->{'dispatchers'} : []; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 38 | return { | ||||||||||
| 39 | 2 | format => undef, | |||||||||
| 40 | dispatchers => $dispatchers, | ||||||||||
| 41 | }; | ||||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | |||||||||||
| 45 | 4 | ▶ | sub get_attrs { | ||||||||
|
Subroutine
get_attrs: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 46 | 4 | my($self, $name) = @_; | |||||||||
| 47 | 4 | return $self->{'_config'}->{$name}; | |||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | |||||||||||
| 51 | |||||||||||
| 52 | 3 | 1; | |||||||||
| 53 | |||||||||||
| 54 | __END__ | ||||||||||