our $activeSIPServer;
our $activeLogger;
+=head1 NAME
+
+C4::SIP::Logger - Module for handling SIP server logging
+
=head2 get_SIPServer
my $sipServer = C4::SIP::SIPServer::get_SIPServer()
-@RETURNS C4::SIP::SIPServer, the current server's child-process used to handle this SIP-transaction
+ @RETURNS C4::SIP::SIPServer, the current server's child-process used to handle this SIP-transaction
=cut
return $activeSIPServer;
}
+=head2 _set_SIPServer
+
+ my $sipServer = C4::SIP::SIPServer::_set_SIPServer($sipServer)
+
+ Sets the passed in SIP server as the active SIP server and returns it as well
+
+ @RETURNS C4::SIP::SIPServer, the current server's child-process used to handle this SIP-transaction
+
+=cut
+
sub _set_SIPServer {
my ($sipServer) = @_;
$activeSIPServer = $sipServer;
return $activeLogger;
}
+=head2 set_logger
+
+ my $logger = C4::SIP::SIPServer::set_logger($logger)
+
+=cut
+
sub set_logger {
my ($logger) = @_;
$activeLogger = $logger;
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++;