[Opensrf-commits] r2147 - in branches/rel_2_0/src: libopensrf perl/lib/OpenSRF (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Jan 21 10:13:57 EST 2011


Author: erickson
Date: 2011-01-21 10:13:55 -0500 (Fri, 21 Jan 2011)
New Revision: 2147

Modified:
   branches/rel_2_0/src/libopensrf/osrf_application.c
   branches/rel_2_0/src/perl/lib/OpenSRF/Application.pm
Log:
make the api CALL log line consistent across Perl and C and make it something that can be pasted directly into srfsh

Modified: branches/rel_2_0/src/libopensrf/osrf_application.c
===================================================================
--- branches/rel_2_0/src/libopensrf/osrf_application.c	2011-01-21 15:13:50 UTC (rev 2146)
+++ branches/rel_2_0/src/libopensrf/osrf_application.c	2011-01-21 15:13:55 UTC (rev 2147)
@@ -1035,8 +1035,10 @@
 	// Log the call, with the method and parameters
 	char* params_str = jsonObjectToJSON( ctx->params );
 	if( params_str ) {
-		osrfLogInfo( OSRF_LOG_MARK, "CALL:\t%s %s - %s",
-			 ctx->session->remote_service, ctx->method->name, params_str );
+        // params_str will at minimum be "[]"
+        params_str[strlen(params_str) - 1] = '\0'; // drop the trailing ']'
+		osrfLogInfo( OSRF_LOG_MARK, "CALL: %s %s %s",
+			 ctx->session->remote_service, ctx->method->name, params_str + 1);
 		free( params_str );
 	}
 	return 0;

Modified: branches/rel_2_0/src/perl/lib/OpenSRF/Application.pm
===================================================================
--- branches/rel_2_0/src/perl/lib/OpenSRF/Application.pm	2011-01-21 15:13:50 UTC (rev 2146)
+++ branches/rel_2_0/src/perl/lib/OpenSRF/Application.pm	2011-01-21 15:13:55 UTC (rev 2147)
@@ -127,7 +127,7 @@
         my @p = $app_msg->params;
 		my $method_name = $app_msg->method;
 		my $method_proto = $session->last_message_api_level;
-		$log->info("CALL: $method_name [". (@p ? join(', ', at p) : '') ."]");
+		$log->info("CALL: ".$session->service." $method_name ". (@p ? join(', ', at p) : ''));
 
 		my $coderef = $app->method_lookup( $method_name, $method_proto, 1, 1 );
 



More information about the opensrf-commits mailing list