line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Log::Dispatch::Configurator::AppConfig; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
38
|
use strict; |
|
8
|
|
|
|
|
9
|
|
|
8
|
|
|
|
|
318
|
|
4
|
8
|
|
|
8
|
|
38
|
use vars qw($VERSION); |
|
8
|
|
|
|
|
9
|
|
|
8
|
|
|
|
|
463
|
|
5
|
|
|
|
|
|
|
$VERSION = 0.11_02; |
6
|
|
|
|
|
|
|
|
7
|
8
|
|
|
8
|
|
2982
|
use Log::Dispatch::Configurator; |
|
8
|
|
|
|
|
17
|
|
|
8
|
|
|
|
|
229
|
|
8
|
8
|
|
|
8
|
|
41
|
use base qw(Log::Dispatch::Configurator); |
|
8
|
|
|
|
|
12
|
|
|
8
|
|
|
|
|
727
|
|
9
|
8
|
|
|
8
|
|
5385
|
use AppConfig; |
|
8
|
|
|
|
|
40071
|
|
|
8
|
|
|
|
|
2374
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub parse { |
12
|
9
|
|
|
9
|
0
|
12
|
my $self = shift; |
13
|
9
|
|
|
|
|
52
|
my $config = AppConfig->new({ |
14
|
|
|
|
|
|
|
CREATE => 1, |
15
|
|
|
|
|
|
|
GLOBAL => { |
16
|
|
|
|
|
|
|
ARGCOUNT => AppConfig::ARGCOUNT_ONE(), |
17
|
|
|
|
|
|
|
}, |
18
|
|
|
|
|
|
|
}); |
19
|
9
|
|
|
|
|
1118
|
$config->define(dispatchers => { DEFAULT => '' }); |
20
|
9
|
|
|
|
|
782
|
$config->define(format => { DEFAULT => undef }); |
21
|
9
|
|
|
|
|
499
|
$config->file($self->{file}); |
22
|
|
|
|
|
|
|
|
23
|
9
|
|
|
|
|
32301
|
$self->{_config} = $config; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
31
|
|
|
31
|
|
428
|
sub _config { $_[0]->{_config} } |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub get_attrs_global { |
29
|
9
|
|
|
9
|
0
|
14
|
my $self = shift; |
30
|
|
|
|
|
|
|
return { |
31
|
9
|
|
|
|
|
24
|
format => scalar $self->_config->get('format'), |
32
|
|
|
|
|
|
|
dispatchers => [ split /\s+/, $self->_config->get('dispatchers') ], |
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub get_attrs { |
37
|
13
|
|
|
13
|
0
|
25
|
my($self, $name) = @_; |
38
|
13
|
|
|
|
|
31
|
my $regex = "^$name" . '[\._]'; |
39
|
13
|
|
|
|
|
29
|
my %var = $self->_config->varlist($regex); |
40
|
55
|
|
|
|
|
253
|
my %param = map { |
41
|
13
|
|
|
|
|
701
|
(my $key = $_) =~ s/$regex//; |
42
|
55
|
|
|
|
|
153
|
$key => $var{$_}; |
43
|
|
|
|
|
|
|
} keys %var; |
44
|
13
|
|
|
|
|
84
|
return \%param; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
__END__ |