Phprest\ErrorHandler\Handler\Log::handle PHP Method

handle() public method

public handle ( Exception $exception )
$exception Exception
    public function handle(\Exception $exception)
    {
        if ($exception instanceof \ErrorException) {
            $this->handleErrorException($exception);
            return;
        }
        $this->logger->critical($this->buildLogMessage($exception));
    }

Usage Example

Example #1
0
 public function testInfoExceptionErrorLog()
 {
     $this->assertFalse($this->monologHandler->hasInfoRecords());
     $this->logHandler->handle(new \ErrorException('test exception', 0, E_STRICT));
     $this->assertTrue($this->monologHandler->hasInfoRecords());
 }