9 die if $Log::Log4perl::VERSION < 1.29;
15 plan skip_all => 'Log::Log4perl 1.29 not installed'
19 unlink 'myerrs.log' if -e 'myerrs.log';
20 Log::Log4perl->init("$FindBin::Bin/log4perl.conf");
21 use Log::Contextual qw( :log set_logger );
22 set_logger(Log::Log4perl->get_logger);
26 push @elines, __LINE__ and log_error { 'err FIRST' };
29 push @elines, __LINE__ and log_error { 'err SECOND' };
32 open my $log, '<', 'myerrs.log';
36 is $datas[0], "file:t/log4perl.t line:$elines[0] method:main:: - err FIRST\n",
37 'file and line work with Log4perl';
39 "file:t/log4perl.t line:$elines[1] method:main::foo - err SECOND\n",
40 'file and line work with Log4perl in a sub';