/**
* Logs exception, catching all possible errors during logging.
*
* @param \Throwable $error An Exception or Throwable (PHP 7+) object to get error message from.
*
* @return void
*
* @since 3.10.0
*/
protected static function logException(\Throwable $error)
{
// Try to log the error, but don't let the logging cause a fatal error
try {
Log::add(sprintf('Uncaught Throwable of type %1$s thrown with message "%2$s". Stack trace: %3$s', \get_class($error), $error->getMessage(), $error->getTraceAsString()), Log::CRITICAL, 'error');
} catch (\Throwable $e) {
// Logging failed, don't make a stink about it though
}
}