/** * Uncaught exception handler. Triggers the `log` and `error` events. * * Logs all except {@link \H\X} because it's intended for the user and can have large payloads. * * PHP 5-7 compatible. * * @param \Exception|\Throwable $thrown */ private static function phpExceptionHandler($thrown) { !$thrown instanceof X and E::notify('log', $thrown, $thrown->getCode()); E::notify('error', $thrown); }
/** * Convenience function to notify the `log` event. * * See {@link \H\H::init()} * * @param string $message * @param int $type */ public static function log($message, $type = 100) { E::notify('log', $message, $type); }