blob: 2d64281c390ce0ec27d9c46136bc6bec7b691378 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
###########################################
# Test Suite for ':resurrect' tag
# Mike Schilli, 2004 (m@perlmeister.com)
###########################################
BEGIN {
if($ENV{INTERNAL_DEBUG}) {
require Log::Log4perl::InternalDebug;
Log::Log4perl::InternalDebug->enable();
}
}
use warnings;
use strict;
use Test::More;
use Log::Log4perl::Appender::TestBuffer;
BEGIN {
eval {
require Filter::Util::Call;
};
if($@) {
plan skip_all => "Filter::Util::Call not available";
} else {
plan tests => 1;
}
}
use Log::Log4perl qw(:easy :resurrect);
Log::Log4perl->easy_init($DEBUG);
Log::Log4perl::Appender::TestBuffer->reset();
Log::Log4perl->init(\ <<EOT);
log4perl.rootLogger=DEBUG, A1
log4perl.appender.A1=Log::Log4perl::Appender::TestBuffer
log4perl.appender.A1.layout=org.apache.log4j.PatternLayout
log4perl.appender.A1.layout.ConversionPattern=%m %n
EOT
# All of these should be activated
###l4p DEBUG "first";
###l4p DEBUG "second";
DEBUG "third";
is(Log::Log4perl::Appender::TestBuffer->by_name("A1")->buffer(),
"first \nsecond \nthird \n", "Hidden statements via ###l4p");
|