改名
This commit is contained in:
@@ -71,7 +71,7 @@ class ErrorHandler extends Component implements ErrorInterface
|
|||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function exceptionHandler($exception)
|
public function exceptionHandler(Exception $exception)
|
||||||
{
|
{
|
||||||
$this->category = 'exception';
|
$this->category = 'exception';
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ class ErrorHandler extends Component implements ErrorInterface
|
|||||||
|
|
||||||
$data = JSON::to(500, $error[1], $path);
|
$data = JSON::to(500, $error[1], $path);
|
||||||
|
|
||||||
Snowflake::app()->getLogger()->error($data, 'error');
|
logger()->error($data, 'error');
|
||||||
|
|
||||||
$event = Snowflake::app()->event;
|
$event = Snowflake::app()->event;
|
||||||
$event->trigger(Event::RELEASE_ALL);
|
$event->trigger(Event::RELEASE_ALL);
|
||||||
@@ -123,7 +123,7 @@ class ErrorHandler extends Component implements ErrorInterface
|
|||||||
|
|
||||||
$data = JSON::to($code, $this->category . ': ' . $message, $path);
|
$data = JSON::to($code, $this->category . ': ' . $message, $path);
|
||||||
|
|
||||||
Snowflake::app()->getLogger()->trance($data, $this->category);
|
logger()->trance($data, $this->category);
|
||||||
|
|
||||||
return response()->send($data);
|
return response()->send($data);
|
||||||
}
|
}
|
||||||
@@ -154,6 +154,6 @@ class ErrorHandler extends Component implements ErrorInterface
|
|||||||
*/
|
*/
|
||||||
public function writer($message, $category = 'app')
|
public function writer($message, $category = 'app')
|
||||||
{
|
{
|
||||||
Snowflake::app()->getLogger()->debug($message, $category);
|
logger()->debug($message, $category);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ class Logger extends Component
|
|||||||
* @return false|int|mixed|string
|
* @return false|int|mixed|string
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function exception($exception)
|
public function exception(Exception $exception)
|
||||||
{
|
{
|
||||||
$errorInfo = [
|
$errorInfo = [
|
||||||
'message' => $exception->getMessage(),
|
'message' => $exception->getMessage(),
|
||||||
@@ -267,7 +267,7 @@ class Logger extends Component
|
|||||||
* @param Exception $exception
|
* @param Exception $exception
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
private function getException($exception)
|
private function getException(Exception $exception)
|
||||||
{
|
{
|
||||||
$_tmp = [$exception->getMessage()];
|
$_tmp = [$exception->getMessage()];
|
||||||
$_tmp[] = $exception->getFile() . ' on line ' . $exception->getLine();
|
$_tmp[] = $exception->getFile() . ' on line ' . $exception->getLine();
|
||||||
|
|||||||
Reference in New Issue
Block a user