Skip to content

Commit

Permalink
Fix logException message building
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolastuttle authored and jdpanderson committed Sep 5, 2024
1 parent ca23f65 commit 14dc0e7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
Expand Down

0 comments on commit 14dc0e7

Please sign in to comment.