33
44use Exception ;
55use Packaged \Helpers \ValueAs ;
6+ use Packaged \Log \Log ;
67use Packaged \Queue \IBatchQueueProvider ;
78use Packaged \Queue \Provider \AbstractQueueProvider ;
89use Packaged \Queue \Provider \QueueConnectionException ;
@@ -155,7 +156,7 @@ public function pushBatch(array $batch, $persistent = null)
155156
156157 if ($ needDeclare )
157158 {
158- $ this -> _log ("Auto-declaring exchange and queue " );
159+ Log:: debug ("Auto-declaring exchange and queue " );
159160 $ declareAttempts ++;
160161 $ this ->declareExchange ();
161162 $ this ->declareQueue ();
@@ -226,10 +227,7 @@ public function push($data, $persistent = null)
226227 $ duration = (microtime (true ) - $ startTime ) * 1000 ;
227228 if ($ duration > $ this ->_slowPushThreshold )
228229 {
229- error_log (
230- 'Slow push to queue ' . $ this ->_queueName . ' took '
231- . round ($ duration , 1 ) . 'ms '
232- );
230+ Log::warning ('Slow push to queue. took ' . round ($ duration , 1 ) . 'ms ' );
233231 }
234232 }
235233 return $ this ;
@@ -579,7 +577,7 @@ protected function _getConnection($connectionMode)
579577 }
580578 catch (Exception $ e )
581579 {
582- $ this -> _log ('AMQP host failed to connect [ ' . $ e ->getMessage () . '] ( ' . $ host . ') ' );
580+ Log:: error ('AMQP host failed to connect [ ' . $ e ->getMessage () . '] ( ' . $ host . ') ' );
583581 array_shift ($ this ->_hosts );
584582 }
585583 $ this ->_persistentDefault = ValueAs::bool ($ config ->getItem ('persistent ' , false ));
@@ -597,7 +595,7 @@ protected function _getConnection($connectionMode)
597595 }
598596 catch (AMQPRuntimeException $ e )
599597 {
600- $ this -> _log ('Unable to start heartbeat sender. ' . $ e ->getMessage ());
598+ Log:: error ('Unable to start heartbeat sender. ' . $ e ->getMessage ());
601599 }
602600
603601 return $ this ->_connections [$ connectionMode ];
@@ -639,7 +637,7 @@ protected function _getChannel($connectionMode)
639637 }
640638 catch (Exception $ e )
641639 {
642- $ this -> _log (
640+ Log:: error (
643641 'Error getting AMQP channel [ ' . $ e ->getMessage () . '] ( ' . $ retries . ' retries remaining) '
644642 );
645643 $ this ->disconnect ($ connectionMode );
0 commit comments