Bugzilla – Attachment 103089 Details for
Bug 25172
Koha::Logger init is failing silently
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25172: Remove _recheck_logfile
Bug-25172-Remove-rechecklogfile.patch (text/plain), 2.03 KB, created by
Jonathan Druart
on 2020-04-16 14:53:43 UTC
(
hide
)
Description:
Bug 25172: Remove _recheck_logfile
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-04-16 14:53:43 UTC
Size:
2.03 KB
patch
obsolete
>From 60efb2c57af49453f3f252e6a160bb80cfa0d270 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 16 Apr 2020 16:12:32 +0200 >Subject: [PATCH] Bug 25172: Remove _recheck_logfile > >I don't understand how that could be useful. We do not want to test if >the logfile is writable every time we log something! >--- > Koha/Logger.pm | 29 +++-------------------------- > 1 file changed, 3 insertions(+), 26 deletions(-) > >diff --git a/Koha/Logger.pm b/Koha/Logger.pm >index fb545af544..28a6fb9094 100644 >--- a/Koha/Logger.pm >+++ b/Koha/Logger.pm >@@ -86,17 +86,8 @@ sub AUTOLOAD { > my $method = $Koha::Logger::AUTOLOAD; > $method =~ s/^Koha::Logger:://; > >- if ( !exists $self->{logger} ) { >- >- #do not use log4perl; no print to stderr >- } >- elsif ( !$self->_recheck_logfile ) { >- warn "Log file not writable for log4perl"; >- warn "$method: $line" if $line; >- } >- elsif ( $self->{logger}->can($method) ) { #use log4perl >- $self->{logger}->$method($line); >- return 1; >+ if ( $self->{logger}->can($method) ) { #use log4perl >+ return $self->{logger}->$method($line); > } > else { # we should not really get here > warn "ERROR: Unsupported method $method"; >@@ -112,7 +103,7 @@ sub AUTOLOAD { > > sub DESTROY { } > >-=head2 _init, _recheck_logfile >+=head2 _init > > =cut > >@@ -133,20 +124,6 @@ sub _init { > return Log::Log4perl->init_once($log4perl_config); > } > >-sub _recheck_logfile { # recheck saved logfile when logging message >- my $self = shift; >- >- return 1 if !exists $self->{logs}; # remember? your own responsibility >- my $opac = $self->{cat} =~ /^OPAC/; >- my $log; >- foreach ( @{ $self->{logs} } ) { >- $log = $_ if $opac && /^OPAC:/ || !$opac && /^INTRANET:/; >- last if $log; >- } >- $log =~ s/^(OPAC|INTRANET)://; >- return -w $log; >-} >- > =head2 debug_to_screen > > Adds a new appender for the given logger that will log all DEBUG-and-higher messages to stderr. >-- >2.20.1
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 25172
:
103088
|
103089
|
103090
|
103091
|
103300
|
103301
|
103302
|
103303
|
103304
|
103305
|
103306
|
103307
|
103310
|
103391
|
103392
|
103393
|
103394
|
103395
|
103485