From 8cb408cf15663dfc68762d0d1bb8f746b9bfa00d Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 29 Apr 2020 06:42:29 -0400 Subject: [PATCH] Bug 15253: Add POD to C4/SIP/Logger.pm and C4/SIP/Trapper.pm Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- C4/SIP/Logger.pm | 22 +++++++++++++++++++++- C4/SIP/Trapper.pm | 16 ++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/C4/SIP/Logger.pm b/C4/SIP/Logger.pm index 8eff6826e2..41169219d1 100644 --- a/C4/SIP/Logger.pm +++ b/C4/SIP/Logger.pm @@ -6,11 +6,15 @@ use Modern::Perl; 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 @@ -18,6 +22,16 @@ sub get_SIPServer { 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; @@ -36,6 +50,12 @@ sub get_logger { return $activeLogger; } +=head2 set_logger + + my $logger = C4::SIP::SIPServer::set_logger($logger) + +=cut + sub set_logger { my ($logger) = @_; $activeLogger = $logger; diff --git a/C4/SIP/Trapper.pm b/C4/SIP/Trapper.pm index 8dce10ed0c..8f115b59b7 100644 --- a/C4/SIP/Trapper.pm +++ b/C4/SIP/Trapper.pm @@ -4,11 +4,27 @@ 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++; -- 2.39.5