From 14dc0e707366fbea74c8d66d58ffe858192d406f Mon Sep 17 00:00:00 2001 From: Nicolas Tuttle Date: Thu, 5 Sep 2024 14:36:50 -0400 Subject: [PATCH] Fix logException message building --- src/Auth.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Auth.php b/src/Auth.php index dba744f..5a0c578 100644 --- a/src/Auth.php +++ b/src/Auth.php @@ -290,14 +290,16 @@ public function getLogger() * @param Exception $exc The exception to log. * @param string $message The exception message in printf style. * @param string ... Any number of string parameters corresponding to %s placeholders in the message string. - * @noinspection PhpUnusedLocalVariableInspection */ private function logException(Exception $exc, $message /*, ... */) { if ($this->logger) { - $args = array_slice(func_get_args(), 2); $message .= ": %s (%s@%s)"; /* Append exception info to log string. */ - $args = array_merge($args, [$exc->getMessage(), $exc->getFile(), $exc->getLine()]); + $args = array_merge( + [$message], + array_slice(func_get_args(), 2), + [$exc->getMessage(), $exc->getFile(), $exc->getLine()] + ); $this->logger->warning(call_user_func_array('sprintf', $args)); } }