From 8c4e26f74edd210614a460fed4d8bf983973ce30 Mon Sep 17 00:00:00 2001 From: miker Date: Thu, 17 Aug 2006 15:21:56 +0000 Subject: [PATCH] logging cleanup git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@758 9efc2488-bf62-4759-914b-345cdb29e865 --- src/perlmods/OpenSRF/AppSession.pm | 8 +----- src/perlmods/OpenSRF/Application.pm | 31 +++++------------------- src/perlmods/OpenSRF/DomainObject/oilsMessage.pm | 5 ---- src/perlmods/OpenSRF/Transport.pm | 6 ----- 4 files changed, 7 insertions(+), 43 deletions(-) diff --git a/src/perlmods/OpenSRF/AppSession.pm b/src/perlmods/OpenSRF/AppSession.pm index 87b23ae..015985d 100644 --- a/src/perlmods/OpenSRF/AppSession.pm +++ b/src/perlmods/OpenSRF/AppSession.pm @@ -88,10 +88,7 @@ sub server_build { if ( my $thingy = $class->find($sess_id) ) { $thingy->remote_id( $remote_id ); - $logger->debug( "AppSession returning existing session $sess_id", DEBUG ); return $thingy; - } else { - $logger->debug( "AppSession building new server session $sess_id", DEBUG ); } if( $service eq "client" ) { @@ -459,8 +456,6 @@ sub send { my @doc = (); - $logger->debug( "In send2", INTERNAL ); - my $disconnect = 0; my $connecting = 0; @@ -512,7 +507,7 @@ sub send { if($self->stateless && $self->state != CONNECTED) { $self->reset; - $logger->debug("AppSession is stateless in send", DEBUG ); + $logger->debug("AppSession is stateless in send", INTERNAL ); } if( !$self->stateless and $self->state != CONNECTED ) { @@ -918,7 +913,6 @@ sub failed { sub queue_wait { my $self = shift; - OpenSRF::Utils::Logger->debug( "Calling queue_wait(@_)", INTERNAL ); return $self->session->queue_wait(@_) } diff --git a/src/perlmods/OpenSRF/Application.pm b/src/perlmods/OpenSRF/Application.pm index 3d23bd8..2723690 100644 --- a/src/perlmods/OpenSRF/Application.pm +++ b/src/perlmods/OpenSRF/Application.pm @@ -90,22 +90,12 @@ sub handler { return 1; # error? } - $log->debug( "In Application::handler()", DEBUG ); - my $app = $self->application_implementation; - if( $app ) { - $log->debug( "Application is $app", DEBUG); - } - if ($session->last_message_type eq 'REQUEST') { - $log->debug( "We got a REQUEST: ". $app_msg->method); my $method_name = $app_msg->method; - $log->debug( " * Looking up $method_name inside $app", DEBUG); - my $method_proto = $session->last_message_api_level; - $log->debug( " * Method API Level [$method_proto]", DEBUG); my $coderef = $app->method_lookup( $method_name, $method_proto, 1, 1 ); @@ -116,8 +106,6 @@ sub handler { return 1; } - $log->debug( " (we got coderef $coderef", DEBUG); - unless ($session->continue_request) { $session->status( OpenSRF::DomainObject::oilsConnectStatus->new( @@ -131,7 +119,7 @@ sub handler { my @args = $app_msg->params; my $appreq = OpenSRF::AppRequest->new( $session ); - $log->debug( "in_request = $in_request : [" . $appreq->threadTrace."]", DEBUG ); + $log->debug( "in_request = $in_request : [" . $appreq->threadTrace."]", INTERNAL ); if( $in_request ) { $log->debug( "Pushing onto pending requests: " . $appreq->threadTrace, DEBUG ); push @pending_requests, [ $appreq, \@args, $coderef ]; @@ -267,7 +255,7 @@ sub handler { statusCode => STATUS_COMPLETE(), status => 'Request Complete' ) ); } - $log->debug( "Executed: " . $appreq->threadTrace, DEBUG ); + $log->debug( "Executed: " . $appreq->threadTrace, INTERNAL ); } catch Error with { my $e = shift; if(UNIVERSAL::isa($e,"Error")) { @@ -515,8 +503,6 @@ sub method_lookup { } if (defined $meth) { - $log->debug("Looks like we found [$method]!", DEBUG); - $log->debug("Method object is ".Dumper($meth), INTERNAL); if($no_remote and $meth->{remote}) { $log->debug("OH CRAP We're not supposed to return remote methods", WARN); return undef; @@ -547,26 +533,22 @@ sub run { } if (!$self->{remote}) { - my $code ||= \&{$self->{package} . '::' . $self->{method}}; - $log->debug("Created coderef [$code] for $$self{package}::$$self{method}",DEBUG); + my $code = \&{$self->{package} . '::' . $self->{method}}; my $err = undef; try { $resp = $code->($self, $req, @params); } catch Error with { - my $e = shift; - $err = $e; - warn "Method 'run' catching error: $e\n"; + $err = shift; if( ref($self) eq 'HASH') { - $log->error("Sub $$self{package}::$$self{method} DIED!!!\n\t$e\n", ERROR); + $log->error("Sub $$self{package}::$$self{method} DIED!!!\n\t$err\n", ERROR); } }; if($err) { if(UNIVERSAL::isa($err,"Error")) { - warn "Throwing from method run:\n$err\n------------------\n"; throw $err; } else { die $err->stringify; @@ -577,9 +559,8 @@ sub run { $log->debug("Coderef for [$$self{package}::$$self{method}] has been run", DEBUG); if ( ref($req) and UNIVERSAL::isa($req, 'OpenSRF::AppSubrequest') ) { - $log->debug("A SubRequest object is responding", DEBUG); $req->respond($resp) if (defined $resp); - $log->debug("... Responding with : " . join(" ",$req->responses), DEBUG); + $log->debug("SubRequest object is responding with : " . join(" ",$req->responses), DEBUG); return $req->responses; } else { $log->debug("A top level Request object is responding $resp", DEBUG) if (defined $resp); diff --git a/src/perlmods/OpenSRF/DomainObject/oilsMessage.pm b/src/perlmods/OpenSRF/DomainObject/oilsMessage.pm index 9ab37e3..56fa9d3 100644 --- a/src/perlmods/OpenSRF/DomainObject/oilsMessage.pm +++ b/src/perlmods/OpenSRF/DomainObject/oilsMessage.pm @@ -172,9 +172,6 @@ sub handler { $log->debug(" Received api_level => [$api_level], MType => [$mtype], ". "from [".$session->remote_id."], threadTrace[".$self->threadTrace."]"); - $log->debug("endpoint => [".$session->endpoint."]", DEBUG); - $log->debug("OpenSRF::AppSession->SERVER => [".$session->SERVER()."]", DEBUG); - my $val; if ( $session->endpoint == $session->SERVER() ) { @@ -185,7 +182,6 @@ sub handler { } if( $val ) { - $log->debug("Passing request up to OpenSRF::Application", DEBUG); return OpenSRF::Application->handler($session, $self->payload); } else { $log->debug("Request was handled internally", DEBUG); @@ -219,7 +215,6 @@ sub do_server { if ($session->state == $session->CONNECTING()) { if($mtype ne "CONNECT" and $session->stateless) { - $log->debug("Got message Stateless", DEBUG); return 1; #pass the message up the stack } diff --git a/src/perlmods/OpenSRF/Transport.pm b/src/perlmods/OpenSRF/Transport.pm index d30db4e..68d9148 100644 --- a/src/perlmods/OpenSRF/Transport.pm +++ b/src/perlmods/OpenSRF/Transport.pm @@ -95,9 +95,6 @@ sub handler { } - $logger->transport( - "Transport building/retrieving session: $service, $remote_id, $sess_id", DEBUG ); - # See if the app_session already exists. If so, make # sure the sender hasn't changed if we're a server my $app_session = OpenSRF::AppSession->find( $sess_id ); @@ -158,9 +155,6 @@ sub handler { # up to the message layer for processing. for my $msg (@$doc) { - $logger->debug( "Transport passing up ".$msg->type." from ". - $app_session->remote_id . " with threadTrace [" . $msg->threadTrace."]"); - next unless ( $msg && UNIVERSAL::isa($msg => 'OpenSRF::DomainObject::oilsMessage')); if( $app_session->endpoint == $app_session->SERVER() ) { -- 2.11.0