line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Log::ger::Layout::JSON; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $DATE = '2017-06-28'; # DATE |
4
|
|
|
|
|
|
|
our $VERSION = '0.001'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
3347
|
use 5.010001; |
|
1
|
|
|
|
|
10
|
|
7
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
31
|
|
8
|
1
|
|
|
1
|
|
8
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
37
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
8
|
use parent qw(Log::ger::Layout::LTSV); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub _encode { |
13
|
5
|
|
|
5
|
|
10000
|
my ($pkg, $msg) = @_; |
14
|
|
|
|
|
|
|
|
15
|
5
|
|
|
|
|
10
|
state $json = do { |
16
|
1
|
|
|
|
|
7
|
require JSON::MaybeXS; |
17
|
1
|
|
|
|
|
5
|
JSON::MaybeXS->new->canonical; |
18
|
|
|
|
|
|
|
}; |
19
|
5
|
|
|
|
|
93
|
$json->encode($msg); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub get_hooks { |
23
|
5
|
|
|
5
|
0
|
7269
|
__PACKAGE__->_get_hooks(@_); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
# ABSTRACT: Layout log message as a JSON object (hash) |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__END__ |