Main Koha release repository https://koha-community.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

38 lines
609 B

package C4::SIP::Trapper;
use Modern::Perl;
use Koha::Logger;
=head1 NAME
C4::SIP::Trapper - Module for capturing warnings for the SIP logger
=head2 TIEHANDLE
Ties the given class to this module.
=cut
sub TIEHANDLE {
my $class = shift;
bless [], $class;
}
=head2 PRINT
Captures warnings and directs them to Koha::Logger as well as STDERR
=cut
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;