line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Log::Log4perl::Appender::TAP; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
4766
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
25
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
22
|
|
5
|
1
|
|
|
1
|
|
18
|
use 5.008001; |
|
1
|
|
|
|
|
3
|
|
6
|
1
|
|
|
1
|
|
5
|
use Test2::API qw( context ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
230
|
|
7
|
|
|
|
|
|
|
our @ISA = qw( Log::Log4perl::Appender ); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: Append to TAP output |
10
|
|
|
|
|
|
|
our $VERSION = '0.04'; # VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new |
14
|
|
|
|
|
|
|
{ |
15
|
3
|
|
|
3
|
1
|
2613
|
my $proto = shift; |
16
|
3
|
|
33
|
|
|
19
|
my $class = ref $proto || $proto; |
17
|
3
|
|
|
|
|
10
|
my %args = @_; |
18
|
|
|
|
|
|
|
bless { |
19
|
3
|
|
100
|
|
|
23
|
method => $args{method} || 'note', |
20
|
|
|
|
|
|
|
}, $class; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub log |
24
|
|
|
|
|
|
|
{ |
25
|
2
|
|
|
2
|
0
|
9736
|
my $self = shift; |
26
|
2
|
|
|
|
|
14
|
my %args = @_; |
27
|
2
|
|
|
|
|
31
|
my $method = $self->{method}; |
28
|
2
|
|
|
|
|
11
|
my $ctx = context(); |
29
|
2
|
|
|
|
|
250
|
$ctx->$method($args{message}); |
30
|
2
|
|
|
|
|
355
|
$ctx->release; |
31
|
2
|
|
|
|
|
91
|
return; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |