Bugzilla – Attachment 12265 Details for
Bug 8190
Add a logging module to Koha
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8190: Followup Logger: FIX perlcritic
Bug-8190-Followup-Logger-FIX-perlcritic.patch (text/plain), 1.86 KB, created by
Jonathan Druart
on 2012-09-17 09:29:46 UTC
(
hide
)
Description:
Bug 8190: Followup Logger: FIX perlcritic
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2012-09-17 09:29:46 UTC
Size:
1.86 KB
patch
obsolete
>From 9614f1de6696fc6f1a4c39db4b68bb014bfbf3f2 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Mon, 17 Sep 2012 11:29:40 +0200 >Subject: [PATCH] Bug 8190: Followup Logger: FIX perlcritic > >--- > Koha/Utils/Logger.pm | 4 ++-- > t/Logger.t | 14 +++++++------- > 2 files changed, 9 insertions(+), 9 deletions(-) > >diff --git a/Koha/Utils/Logger.pm b/Koha/Utils/Logger.pm >index 10f74a7..37b24de 100644 >--- a/Koha/Utils/Logger.pm >+++ b/Koha/Utils/Logger.pm >@@ -165,8 +165,8 @@ sub called_by { > push(@subr, $line.$subr); > } > @subr = reverse(@subr); >- foreach $subr (@subr) { >- $str .= $subr; >+ foreach my $sr (@subr) { >+ $str .= $sr; > $str .= " > "; > } > $str =~ s/ > $/: /; >diff --git a/t/Logger.t b/t/Logger.t >index 11addf0..bff7733 100644 >--- a/t/Logger.t >+++ b/t/Logger.t >@@ -53,7 +53,7 @@ $ENV{KOHA_LOG} = undef; > my $log_stderr_file = qq{/tmp/stderr.log}; > $log = undef; > $log = Koha::Utils::Logger->new({level => 3}); >-open(STDERR, ">>$log_stderr_file"); >+open(STDERR, '>>', $log_stderr_file); > $log->error( "an error string"); > $log->normal( "a normal string"); > @lines = get_contains( $log_stderr_file ); >@@ -66,20 +66,20 @@ system( qq{rm $log_stderr_file} ); > sub get_contains { > my $filepath = shift; > my @lines; >- open FILE, "<", $filepath or die "Can't open $filepath: $!"; >- while(<FILE>) { >+ open my $fh, "<", $filepath or die "Can't open $filepath: $!"; >+ while(<$fh>) { > chomp; > push(@lines, $_); > } >- close(FILE); >+ close($fh); > return @lines; > } > > sub truncate_file { > my $filepath = shift; >- open FILE, ">", $filepath or die "Can't open $filepath: $!"; >- truncate FILE, 0; >- close FILE; >+ open my $fh, ">", $filepath or die "Can't open $filepath: $!"; >+ truncate $fh, 0; >+ close $fh; > } > > sub test_calledby { >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8190
:
9921
|
10996
|
12257
|
12264
|
12265
|
12270
|
12282
|
12283
|
12284
|
12287
|
12743
|
12744
|
12745
|
12746
|
13739
|
13740
|
13762
|
13763
|
13925
|
13926
|
14294
|
14296
|
14318
|
14319
|
14320
|
14321
|
14324
|
14388
|
14703
|
14704
|
14705
|
16426
|
16427
|
16428
|
16429
|
16430
|
18799
|
18800
|
18801
|
18802
|
18803
|
18819
|
18820
|
18870
|
18871
|
18872
|
18873
|
18874
|
18875
|
18876
|
18877
|
18880
|
18881
|
18882
|
18883
|
18884
|
18886
|
18887
|
18888
|
18890
|
34837
|
34838
|
34839
|
34840
|
34841
|
34842
|
34843
|
34844
|
34845