line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Plack::Middleware::AccessLog::Structured::ZeroMQ; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Plack::Middleware::AccessLog::Structured::ZeroMQ::VERSION = '0.001000'; |
4
|
|
|
|
|
|
|
} |
5
|
1
|
|
|
1
|
|
211902
|
use parent qw(Plack::Middleware::AccessLog::Structured); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: Access log middleware which passes structured log messages into ZeroMQ |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
293847
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
45
|
|
10
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
5
|
use MRO::Compat; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
13
|
1
|
|
|
1
|
|
1092
|
use Message::Passing::Output::ZeroMQ; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new { |
18
|
|
|
|
|
|
|
my ($class, $arg_ref) = @_; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my $self = $class->next::method($arg_ref); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
unless ($self->logger()) { |
23
|
|
|
|
|
|
|
my $output = Message::Passing::Output::ZeroMQ->new( |
24
|
|
|
|
|
|
|
connect => $self->{connect} || 'tcp://127.0.0.1:5552', |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
$self->logger(sub { |
27
|
|
|
|
|
|
|
$output->consume(@_); |
28
|
|
|
|
|
|
|
}); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
return $self; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |