line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Log::Any::Adapter::Test::Memory; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Log::Any::Adapter::Test::Memory::VERSION = '0.11'; |
4
|
|
|
|
|
|
|
} |
5
|
2
|
|
|
2
|
|
10
|
use Log::Any::Adapter::Util qw(make_method); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
113
|
|
6
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
67
|
|
7
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
68
|
|
8
|
2
|
|
|
2
|
|
11
|
use base qw(Log::Any::Adapter::Base); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1303
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub init { |
11
|
6
|
|
|
6
|
0
|
8
|
my ($self) = @_; |
12
|
|
|
|
|
|
|
|
13
|
6
|
|
|
|
|
29
|
$self->{msgs} = []; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
foreach my $method ( Log::Any->logging_methods() ) { |
17
|
|
|
|
|
|
|
make_method( |
18
|
|
|
|
|
|
|
$method, |
19
|
|
|
|
|
|
|
sub { |
20
|
5
|
|
|
5
|
|
194
|
my ( $self, $text ) = @_; |
21
|
5
|
|
|
|
|
32
|
push( |
22
|
5
|
|
|
|
|
8
|
@{ $self->{msgs} }, |
23
|
|
|
|
|
|
|
{ |
24
|
|
|
|
|
|
|
level => $method, |
25
|
|
|
|
|
|
|
category => $self->{category}, |
26
|
|
|
|
|
|
|
text => $text |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
foreach my $method ( Log::Any->detection_methods() ) { |
34
|
2
|
|
|
2
|
|
3
|
make_method( $method, sub { my ( $self, $msg ) = @_; return 1 } ); |
|
2
|
|
|
|
|
5
|
|
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |