Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Cvs P5ee > [svn:p5ee] r104...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 632 of 694
Post > Topic >>

[svn:p5ee] r10417 - p5ee/trunk/App-WorkQueue/lib/App

by spadkins@[EMAIL PROTECTED] Dec 12, 2007 at 08:34 AM

Author: spadkins
Date: Wed Dec 12 08:34:40 2007
New Revision: 10417

Modified:
   p5ee/trunk/App-WorkQueue/lib/App/WorkQueue.pm

Log:
reworked some logging messages to use the context log instead of simple
print statements

Modified: p5ee/trunk/App-WorkQueue/lib/App/WorkQueue.pm
==============================================================================
--- p5ee/trunk/App-WorkQueue/lib/App/WorkQueue.pm	(original)
+++ p5ee/trunk/App-WorkQueue/lib/App/WorkQueue.pm	Wed Dec 12 08:34:40 2007
@[EMAIL PROTECTED]
 -459,6 +459,8 @[EMAIL PROTECTED]
     &App::sub_entry if ($App::trace);
     my ($self) = @[EMAIL PROTECTED]
 
+    my $context = $self->{context};
+    my $db = $self->_db();
     my ($entry);
     my $STATUS_UNACQUIRED = $self->{STATUS_UNACQUIRED};
     my $STATUS_ACQUIRED   = $self->{STATUS_ACQUIRED};
@[EMAIL PROTECTED]
 -478,7 +480,7 @[EMAIL PROTECTED]
                     $entry = $e;
                     $acquired = $self->_acquire_entry($entry);
                     if ($acquired) {
-                        print "ACQUIRED[M]: [", join("|",@[EMAIL PROTECTED]
), "]\n" if
($verbose);
+                        $context->log({level=>3}, "WorkQueue :
$self->{name} : ACQUIRED[M]: [", join("|",@[EMAIL PROTECTED]
), "]\n");
                         last;
                     }
                     else {
@[EMAIL PROTECTED]
 -498,14 +500,12 @[EMAIL PROTECTED]
                     $entry = $e;
                     $acquired = $self->_acquire_entry($entry);
                     if ($acquired) {
-                        print "ACQUIRED[M]: {", join("|",%$e), "}\n" if
($verbose);
+                        $context->log({level=>3}, "WorkQueue :
$self->{name} : ACQUIRED[M]: [" . join("|", $e->{shop_request_id},
$e->{subrequest_id}). "]\n");
                         last;
                     }
                     else {
                         $self->_release_resources($entry);
-                        my $context = $self->{context};
-                        my $db = $self->_db();
-                        $context->log("ACQUISITION FAILED :
shop_request_id[$entry->{shop_request_id}] :
subrequest_id[$entry->{subrequest_id}] :
request_status[$entry->{request_status}] : last sql stmt[$db->{sql}]\n");
+                        $context->log({level=>1}, "WorkQueue :
$self->{name} : ACQUISITION FAILED :
[$entry->{shop_request_id}|$entry->{subrequest_id}] : last sql
stmt[$db->{sql}]\n");
                         $entry = undef;
                         # the following line appears to have been a bug
                        
#$self->_maintain_queue_buffers("release",$entry);
@[EMAIL PROTECTED]
 -516,7 +516,7 @[EMAIL PROTECTED]
         }
     }
 
-    print "ACQUIRED[M]: undef\n" if (!$entry && $verbose);
+    $context->log({level=>3}, "WorkQueue : $self->{name} : ACQUIRED[M]:
undef\n") if (!$entry);
     &App::sub_exit($entry) if ($App::trace);
     return($entry);
 }




 1 Posts in Topic:
[svn:p5ee] r10417 - p5ee/trunk/App-WorkQueue/lib/App
spadkins@[EMAIL PROTECTED  2007-12-12 08:34:41 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue May 13 21:38:26 CDT 2008.