Koha/C4/SIP/Trapper.pm
Kyle M Hall 46c9d97cfd
Bug 15253: Log trapped errors as log level 'warn' instead of 'error'
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-05-12 11:46:57 +01:00

22 lines
367 B
Perl

package C4::SIP::Trapper;
use Modern::Perl;
use Koha::Logger;
sub TIEHANDLE {
my $class = shift;
bless [], $class;
}
sub PRINT {
my $self = shift;
$Log::Log4perl::caller_depth++;
my $logger =
Koha::Logger->get( { interface => 'sip', category => 'STDERR' } );
warn @_;
$logger->warn(@_);
$Log::Log4perl::caller_depth--;
}
1;