line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
13
|
use v5.14.0; |
|
1
|
|
|
|
|
12
|
|
2
|
|
|
|
|
|
|
package JMAP::Tester::LogWriter 0.103; |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
5
|
use Moo::Role; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
15
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
requires 'write'; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
388
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
{ |
11
|
|
|
|
|
|
|
package JMAP::Tester::LogWriter::Code 0.103; |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
280
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
14
|
1
|
|
|
1
|
|
356
|
use namespace::clean; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
15
|
|
|
|
|
|
|
with 'JMAP::Tester::LogWriter'; |
16
|
|
|
|
|
|
|
has code => (is => 'ro', required => 1); |
17
|
0
|
|
|
0
|
0
|
|
sub write { $_[0]->code->($_[1]) } |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
{ |
21
|
|
|
|
|
|
|
package JMAP::Tester::LogWriter::Handle 0.103; |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
1
|
|
593
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
24
|
1
|
|
|
1
|
|
360
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
25
|
|
|
|
|
|
|
with 'JMAP::Tester::LogWriter'; |
26
|
|
|
|
|
|
|
has handle => (is => 'ro', required => 1); |
27
|
0
|
|
|
0
|
0
|
|
sub write { $_[0]->handle->print($_[1]) } |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
{ |
31
|
|
|
|
|
|
|
package JMAP::Tester::LogWriter::Filename 0.103; |
32
|
|
|
|
|
|
|
|
33
|
1
|
|
|
1
|
|
579
|
use Moo; |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
6
|
|
34
|
1
|
|
|
1
|
|
331
|
use namespace::clean; |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
6
|
|
35
|
|
|
|
|
|
|
with 'JMAP::Tester::LogWriter'; |
36
|
|
|
|
|
|
|
has filename_template => ( |
37
|
|
|
|
|
|
|
is => 'ro', |
38
|
|
|
|
|
|
|
default => 'jmap-tester-{T}-{PID}.log', |
39
|
|
|
|
|
|
|
); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
has _handle => (is => 'rw'); |
42
|
|
|
|
|
|
|
has _pid => (is => 'rw', init_arg => undef, default => -1); |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
0
|
0
|
|
sub write { $_[0]->_ensure_handle->print($_[1]) } |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub _ensure_handle { |
47
|
0
|
|
|
0
|
|
|
my ($self) = @_; |
48
|
0
|
0
|
|
|
|
|
return $self->_handle if $self->_pid == $$; |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
my $fn = $self->filename_template =~ s/\{T\}/$^T/gr =~ s/\{PID\}/$$/gr; |
51
|
0
|
0
|
|
|
|
|
open my $fh, '>>', $fn or Carp::confess("can't open $fn for writing: $!"); |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
$fh->autoflush(1); |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
$self->_handle($fh); |
56
|
0
|
|
|
|
|
|
$self->_pid($$); |
57
|
0
|
|
|
|
|
|
return $fh; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
__END__ |