/** * Shorthand: Logs the given Exception. * * @param Throwable|Exception $exception The Exception to log */ public static function logException($exception) { if ($exception instanceof ErrorException) { self::logError($exception->getSeverity(), $exception->getMessage(), $exception->getFile(), $exception->getLine()); } else { $logger = self::factory(); $logger->log(get_class($exception), $exception->getMessage(), [], $exception->getFile(), $exception->getLine()); } }
/** * @param Throwable $exception * * @return string */ public static function getTypeDescription($exception) { if ($exception instanceof ErrorException) { $type = 'PHP Error ' . self::getErrorType($exception->getSeverity()); } elseif ($exception instanceof Ajde_Exception) { $type = 'Application exception' . ($exception->getCode() ? ' ' . $exception->getCode() : ''); } else { $type = 'PHP exception ' . $exception->getCode(); } return $type; }