Log4perl/Appender/TestFileCreeper.pm untested

filter: Statementstmt 0.0% 0 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 23 CC 1 SCAR 6.9
CC
1
Cov
0%
log
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 ##################################################
2 package Log::Log4perl::Appender::TestFileCreeper;
3 ##################################################
4 # Test appender, intentionally slow. It writes
5 # out one byte at a time to provoke sync errors.
6 # Don't use it, unless for testing.
7 ##################################################
8  
9 use warnings;
10 use strict;
11  
12 use Log::Log4perl::Appender::File;
13  
14 our @ISA = qw(Log::Log4perl::Appender::File);
15  
16 ##################################################
17 sub log {
18 ##################################################
19 my($self, %params) = @_;
20  
21 my $fh = $self->{fh};
22  
23 for (split //, $params{message}) {
24 print $fh $_;
25 my $oldfh = select $self->{fh};
26 $| = 1;
27 select $oldfh;
28 }
29 }
30  
31 1;
32  
33 __END__