added qw(:level) to CDBI.pm because we were getting empty log levels
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 1 Dec 2005 21:02:44 +0000 (21:02 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 1 Dec 2005 21:02:44 +0000 (21:02 +0000)
made log output a little more descriptive (more to do)

setting log service in math bench

slimmed the logging in the gateway

git-svn-id: svn://svn.open-ils.org/ILS/trunk@2149 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm
OpenSRF/examples/math_bench.pl
OpenSRF/src/gateway/mod_ils_gateway.c
OpenSRF/src/perlmods/OpenSRF/Utils/Logger.pm

index da41af8..d19a096 100644 (file)
@@ -15,7 +15,7 @@ use OpenILS::Application::Storage::CDBI::permission;
 use OpenILS::Application::Storage::CDBI::container;
 
 use JSON;
-use OpenSRF::Utils::Logger;
+use OpenSRF::Utils::Logger qw(:level);
 use OpenSRF::EX qw/:try/;
 
 our $VERSION = undef;
index 2d991f5..c3a504c 100755 (executable)
@@ -2,6 +2,8 @@
 use strict; use warnings;
 use OpenSRF::System;
 use Time::HiRes qw/time/;
+use OpenSRF::Utils::Logger;
+my $log = "OpenSRF::Utils::Logger";
 
 # Test script which runs queries agains the opensrf.math service and reports on
 # the average round trip time of the requests.
@@ -12,6 +14,7 @@ print "usage: $0 <num_requests>\n" and exit unless $count;
 
 # * connect to the Jabber network
 OpenSRF::System->bootstrap_client( config_file => "/openils/conf/bootstrap.conf" );
+$log->set_service('math_bench');
 
 # * create a new application session for the opensrf.math service
 my $session = OpenSRF::AppSession->create( "opensrf.math" );
index 1f5f8bd..28e1337 100644 (file)
@@ -176,9 +176,7 @@ static int mod_ils_gateway_method_handler (request_rec *r) {
 
        char* content = jsonObjectToJSON(response);
        if(content) {
-               osrfLogInfo( "----------------------------------------------\n"
-                       "Gateway responding with:\n%s\n"
-                       "----------------------------------------------", content );
+               osrfLogInfo( "Gateway responding with:  %s", content );
                ap_rputs(content,r);
                free(content);
        } 
index 6d71eb3..607b65d 100644 (file)
@@ -200,6 +200,8 @@ sub _log_message {
 
        #my( $pack, $file, $line_no ) = @caller;
 
+       $msg = "[$n:"."$$".":::] $msg";
+
        if( $level == ACTIVITY() ) {
                if( is_act_syslog() ) { syslog( $fac | $l, $msg ); } 
                elsif( is_act_filelog() ) { _write_file( $msg, 1 ); }