line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OpenTracing::Log; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
13
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
65
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
102
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.005'; # VERSION |
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TEAM'; # AUTHORITY |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
10
|
use parent qw(OpenTracing::Common); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
9
|
|
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
120
|
no indirect; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
10
|
|
12
|
2
|
|
|
2
|
|
97
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
21
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=encoding utf8 |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 NAME |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
OpenTracing::Log - represents a single log message |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 DESCRIPTION |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Each instance represents one log message. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=cut |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 METHODS |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head2 timestamp |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
When this message was logged. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
0
|
1
|
|
sub timestamp { shift->{timestamp} } |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head2 tags |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Arrayref of tags relating to the log entry. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=cut |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
0
|
1
|
|
sub tags { shift->{tags} } |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head2 tag_list |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
List of tags relating to the log entry. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
0
|
0
|
1
|
|
sub tag_list { (shift->{tags} //= [])->@* } |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 tag |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Applies key/value tags to this log message. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
The L |
57
|
|
|
|
|
|
|
may be of interest here. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Example usage: |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
$log->tag( |
62
|
|
|
|
|
|
|
'error.kind' => 'Exception', |
63
|
|
|
|
|
|
|
'error.object' => $exception, |
64
|
|
|
|
|
|
|
); |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub tag : method { |
69
|
0
|
|
|
0
|
1
|
|
my ($self, %args) = @_; |
70
|
0
|
|
|
|
|
|
@{$self->{tags}}{keys %args} = values %args; |
|
0
|
|
|
|
|
|
|
71
|
0
|
|
|
|
|
|
return $self; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
1; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
__END__ |