6 if (!eval "use Log::Log4perl; 1") {
7 plan skip_all => 'Log::Log4perl not installed'
13 unlink 'myerrs.log' if -e 'myerrs.log';
14 Log::Log4perl->init("$FindBin::Bin/log4perl.conf");
15 use Log::Contextual qw( :log set_logger );
16 set_logger(Log::Log4perl->get_logger);
18 log_error { 'err 14' };
21 log_error { 'err 17' };
24 open my $log, '<', 'myerrs.log';
28 is $datas[0], "file:t/log4perl.t line:18 method:main:: - err 14\n", 'file and line work with Log4perl';
29 is $datas[1], "file:t/log4perl.t line:21 method:main::foo - err 17\n", 'file and line work with Log4perl in a sub';