From 97372949016b33ad192bdab2c17283567340c406 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 21 Jan 2011 14:58:35 +0000 Subject: [PATCH] make the api CALL log line consistent across Perl and C and make it something that can be pasted directly into srfsh git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@2144 9efc2488-bf62-4759-914b-345cdb29e865 --- src/libopensrf/osrf_application.c | 6 ++++-- src/perl/lib/OpenSRF/Application.pm | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libopensrf/osrf_application.c b/src/libopensrf/osrf_application.c index b75d2bb..57a372b 100644 --- a/src/libopensrf/osrf_application.c +++ b/src/libopensrf/osrf_application.c @@ -1035,8 +1035,10 @@ int osrfMethodVerifyContext( osrfMethodContext* ctx ) // 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; diff --git a/src/perl/lib/OpenSRF/Application.pm b/src/perl/lib/OpenSRF/Application.pm index 8ccf568..6ebfe4b 100644 --- a/src/perl/lib/OpenSRF/Application.pm +++ b/src/perl/lib/OpenSRF/Application.pm @@ -127,7 +127,7 @@ sub handler { 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(', ',@p) : '') ."]"); + $log->info("CALL: ".$session->service." $method_name ". (@p ? join(', ',@p) : '')); my $coderef = $app->method_lookup( $method_name, $method_proto, 1, 1 ); -- 2.11.0