line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JLogger::Handler::Message; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
904
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use base 'JLogger::Handler'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
564
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub handle { |
9
|
0
|
|
|
0
|
0
|
|
my ($self, $node) = @_; |
10
|
|
|
|
|
|
|
|
11
|
0
|
0
|
|
|
|
|
if (my $body_node = ($node->find_all(['component' => 'body']))[0]) { |
12
|
0
|
|
|
|
|
|
my $message = { |
13
|
|
|
|
|
|
|
from => $node->attr('from'), |
14
|
|
|
|
|
|
|
to => $node->attr('to'), |
15
|
|
|
|
|
|
|
type => 'message', |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
id => $node->attr('id'), |
18
|
|
|
|
|
|
|
message_type => $node->attr('type'), |
19
|
|
|
|
|
|
|
body => $body_node->text, |
20
|
|
|
|
|
|
|
}; |
21
|
|
|
|
|
|
|
|
22
|
0
|
0
|
|
|
|
|
if (my $thread_node = ($node->find_all(['component' => 'thread']))[0]) |
23
|
|
|
|
|
|
|
{ |
24
|
0
|
|
|
|
|
|
$message->{thread} = $thread_node->text; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
return $message; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# Ignore empty messages |
31
|
0
|
|
|
|
|
|
return; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |