@@ -83,7 +83,7 @@ protected function checkAndCycleLog()
8383 $ this ->current_log_check ++;
8484 if ($ this ->current_log_check > $ this ->max_check_interval ) {
8585 if ($ this ->current_date != date ('Ymd ' )) {
86- $ this ->logger ->addAlert ("Cycling log file now. " );
86+ $ this ->logger ->alert ("Cycling log file now. " );
8787 $ this ->logger = Logger::cycleLog (
8888 $ this ->queue_name
8989 , $ this ->log_level
@@ -101,11 +101,11 @@ public function workJob()
101101 try {
102102 $ newJob = Base::getJob ($ this ->queue );
103103 } catch (\Exception $ ex ) {
104- $ this ->logger ->addError ($ ex ->getMessage ());
104+ $ this ->logger ->error ($ ex ->getMessage ());
105105 $ sleepTime = self ::RUN_USLEEP * 5 ;
106106 }
107107 if (empty ($ newJob )) {
108- $ this ->logger ->addNotice ("No Job found. " );
108+ $ this ->logger ->notice ("No Job found. " );
109109 $ sleepTime = self ::RUN_USLEEP * 10 ;
110110 } else {
111111 try {
@@ -115,7 +115,7 @@ public function workJob()
115115 if (is_string ($ newJob ->worker )) {
116116 $ result_data = $ this ->processWorker ($ newJob ->worker , $ newJob );
117117 } elseif (is_array ($ newJob ->worker )) {
118- $ this ->logger ->addInfo (sprintf ("Running chained new job (%s) with workers " , $ newJob ->job_id ), $ newJob ->worker );
118+ $ this ->logger ->info (sprintf ("Running chained new job (%s) with workers " , $ newJob ->job_id ), $ newJob ->worker );
119119 foreach ($ newJob ->worker as $ worker_name ) {
120120 $ result_data = $ this ->processWorker ($ worker_name , $ newJob );
121121 $ newJob ->data = $ result_data ;
@@ -124,22 +124,22 @@ public function workJob()
124124
125125 return Base::updateJob ($ this ->queue , $ newJob ->job_id , $ result_data );
126126 } catch (\Exception $ ex ) {
127- $ this ->logger ->addError ($ ex ->getMessage ());
128- $ this ->logger ->addInfo (sprintf ('Releasing job (%s). ' , $ newJob ->job_id ));
127+ $ this ->logger ->error ($ ex ->getMessage ());
128+ $ this ->logger ->info (sprintf ('Releasing job (%s). ' , $ newJob ->job_id ));
129129 $ this ->queue ->releaseJob ($ newJob ->job_id );
130130 $ sleepTime = self ::RUN_USLEEP * 5 ;
131131 }
132132 }
133- $ this ->logger ->addInfo ('Sleeping ' . ceil ($ sleepTime / 1000000 ) . ' seconds. ' );
133+ $ this ->logger ->info ('Sleeping ' . ceil ($ sleepTime / 1000000 ) . ' seconds. ' );
134134 usleep ($ sleepTime );
135135 }
136136
137137 protected function processWorker ($ worker_name , $ new_job )
138138 {
139- $ this ->logger ->addInfo (sprintf ("Running new job (%s) with worker: %s " , $ new_job ->job_id , $ worker_name ));
139+ $ this ->logger ->info (sprintf ("Running new job (%s) with worker: %s " , $ new_job ->job_id , $ worker_name ));
140140 $ worker = Base::getWorker ($ worker_name );
141141 Base::workJob ($ worker , $ new_job );
142- $ this ->logger ->addInfo (sprintf ('Worker is done. Updating job (%s). Result: ' , $ new_job ->job_id ), $ worker ->result_data );
142+ $ this ->logger ->info (sprintf ('Worker is done. Updating job (%s). Result: ' , $ new_job ->job_id ), $ worker ->result_data );
143143
144144 return $ worker ->result_data ;
145145 }
0 commit comments