View | Details | Raw Unified | Return to bug 8190
Collapse All | Expand All

(-)a/Koha/Utils/Logger.pm (-2 / +2 lines)
Lines 165-172 sub called_by { Link Here
165
        push(@subr, $line.$subr);
165
        push(@subr, $line.$subr);
166
    }
166
    }
167
    @subr = reverse(@subr);
167
    @subr = reverse(@subr);
168
    foreach $subr (@subr) {
168
    foreach my $sr (@subr) {
169
        $str .= $subr;
169
        $str .= $sr;
170
        $str .= " > ";
170
        $str .= " > ";
171
    }
171
    }
172
    $str =~ s/ > $/: /;
172
    $str =~ s/ > $/: /;
(-)a/t/Logger.t (-8 / +7 lines)
Lines 53-59 $ENV{KOHA_LOG} = undef; Link Here
53
my $log_stderr_file = qq{/tmp/stderr.log};
53
my $log_stderr_file = qq{/tmp/stderr.log};
54
$log = undef;
54
$log = undef;
55
$log = Koha::Utils::Logger->new({level => 3});
55
$log = Koha::Utils::Logger->new({level => 3});
56
open(STDERR, ">>$log_stderr_file");
56
open(STDERR, '>>', $log_stderr_file);
57
$log->error( "an error string");
57
$log->error( "an error string");
58
$log->normal( "a normal string");
58
$log->normal( "a normal string");
59
@lines = get_contains( $log_stderr_file );
59
@lines = get_contains( $log_stderr_file );
Lines 66-85 system( qq{rm $log_stderr_file} ); Link Here
66
sub get_contains {
66
sub get_contains {
67
    my $filepath = shift;
67
    my $filepath = shift;
68
    my @lines;
68
    my @lines;
69
    open FILE, "<", $filepath or die "Can't open $filepath: $!";
69
    open my $fh, "<", $filepath or die "Can't open $filepath: $!";
70
    while(<FILE>) {
70
    while(<$fh>) {
71
        chomp;
71
        chomp;
72
        push(@lines, $_);
72
        push(@lines, $_);
73
    }
73
    }
74
    close(FILE);
74
    close($fh);
75
    return @lines;
75
    return @lines;
76
}
76
}
77
77
78
sub truncate_file {
78
sub truncate_file {
79
    my $filepath = shift;
79
    my $filepath = shift;
80
    open FILE, ">", $filepath or die "Can't open $filepath: $!";
80
    open my $fh, ">", $filepath or die "Can't open $filepath: $!";
81
    truncate FILE, 0;
81
    truncate $fh, 0;
82
    close FILE;
82
    close $fh;
83
}
83
}
84
84
85
sub test_calledby {
85
sub test_calledby {
86
- 

Return to bug 8190