@@ -83,7 +83,7 @@ protected function checkAndCycleLog()
83
83
$ this ->current_log_check ++;
84
84
if ($ this ->current_log_check > $ this ->max_check_interval ) {
85
85
if ($ this ->current_date != date ('Ymd ' )) {
86
- $ this ->logger ->addAlert ("Cycling log file now. " );
86
+ $ this ->logger ->alert ("Cycling log file now. " );
87
87
$ this ->logger = Logger::cycleLog (
88
88
$ this ->queue_name
89
89
, $ this ->log_level
@@ -101,11 +101,11 @@ public function workJob()
101
101
try {
102
102
$ newJob = Base::getJob ($ this ->queue );
103
103
} catch (\Exception $ ex ) {
104
- $ this ->logger ->addError ($ ex ->getMessage ());
104
+ $ this ->logger ->error ($ ex ->getMessage ());
105
105
$ sleepTime = self ::RUN_USLEEP * 5 ;
106
106
}
107
107
if (empty ($ newJob )) {
108
- $ this ->logger ->addNotice ("No Job found. " );
108
+ $ this ->logger ->notice ("No Job found. " );
109
109
$ sleepTime = self ::RUN_USLEEP * 10 ;
110
110
} else {
111
111
try {
@@ -115,7 +115,7 @@ public function workJob()
115
115
if (is_string ($ newJob ->worker )) {
116
116
$ result_data = $ this ->processWorker ($ newJob ->worker , $ newJob );
117
117
} 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 );
119
119
foreach ($ newJob ->worker as $ worker_name ) {
120
120
$ result_data = $ this ->processWorker ($ worker_name , $ newJob );
121
121
$ newJob ->data = $ result_data ;
@@ -124,22 +124,22 @@ public function workJob()
124
124
125
125
return Base::updateJob ($ this ->queue , $ newJob ->job_id , $ result_data );
126
126
} 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 ));
129
129
$ this ->queue ->releaseJob ($ newJob ->job_id );
130
130
$ sleepTime = self ::RUN_USLEEP * 5 ;
131
131
}
132
132
}
133
- $ this ->logger ->addInfo ('Sleeping ' . ceil ($ sleepTime / 1000000 ) . ' seconds. ' );
133
+ $ this ->logger ->info ('Sleeping ' . ceil ($ sleepTime / 1000000 ) . ' seconds. ' );
134
134
usleep ($ sleepTime );
135
135
}
136
136
137
137
protected function processWorker ($ worker_name , $ new_job )
138
138
{
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 ));
140
140
$ worker = Base::getWorker ($ worker_name );
141
141
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 );
143
143
144
144
return $ worker ->result_data ;
145
145
}
0 commit comments