line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Log::ger::Layout::YAML; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $DATE = '2017-06-28'; # DATE |
4
|
|
|
|
|
|
|
our $VERSION = '0.001'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
3520
|
use 5.010001; |
|
1
|
|
|
|
|
7
|
|
7
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
8
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
6
|
use parent qw(Log::ger::Layout::LTSV); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub _encode { |
13
|
2
|
|
|
2
|
|
3611
|
my ($pkg, $msg) = @_; |
14
|
|
|
|
|
|
|
|
15
|
2
|
|
|
|
|
4
|
state $yaml = do { |
16
|
1
|
|
|
|
|
372
|
require YAML::XS; |
17
|
|
|
|
|
|
|
}; |
18
|
2
|
|
|
|
|
2053
|
YAML::XS::Dump($msg); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub get_hooks { |
22
|
2
|
|
|
2
|
0
|
2344
|
__PACKAGE__->_get_hooks(@_); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
# ABSTRACT: Layout log message as a YAML |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |