From 47b4df93e63bbdfcc3810ede150ef3f0aa8fb543 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 10 Jun 2020 10:18:52 +1200 Subject: [PATCH] Avoid serialisation in human readable log messages It only does sprintf() on two occurrences in this class, and not anywhere else. I can't see why it's necessary. --- src/Services/QueuedJobService.php | 37 +++++-------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/src/Services/QueuedJobService.php b/src/Services/QueuedJobService.php index 9fa76732..41efa702 100644 --- a/src/Services/QueuedJobService.php +++ b/src/Services/QueuedJobService.php @@ -476,16 +476,7 @@ public function checkJobHealth($queue = null) } $this->getLogger()->error( - print_r( - [ - 'errno' => 0, - 'errstr' => 'Broken jobs were found in the job queue', - 'errfile' => __FILE__, - 'errline' => __LINE__, - 'errcontext' => [], - ], - true - ), + 'Broken jobs were found in the job queue', [ 'file' => __FILE__, 'line' => __LINE__, @@ -842,17 +833,8 @@ public function runJob($jobId) ); if (!$jobDescriptor || !$jobDescriptor->exists()) { $broken = true; - $this->getLogger()->error( - print_r( - [ - 'errno' => 0, - 'errstr' => 'Job descriptor ' . $jobId . ' could not be found', - 'errfile' => __FILE__, - 'errline' => __LINE__, - 'errcontext' => [], - ], - true - ), + $logger->error( + 'Job descriptor ' . $jobId . ' could not be found', [ 'file' => __FILE__, 'line' => __LINE__, @@ -1001,17 +983,8 @@ public function runJob($jobId) $this->copyJobToDescriptor($job, $jobDescriptor); $jobDescriptor->write(); } else { - $this->getLogger()->error( - print_r( - [ - 'errno' => 0, - 'errstr' => 'Job descriptor has been set to null', - 'errfile' => __FILE__, - 'errline' => __LINE__, - 'errcontext' => [], - ], - true - ), + $logger->error( + 'Job descriptor has been set to null', [ 'file' => __FILE__, 'line' => __LINE__,