public function update(\SplSubject $subject, $isException = false) { if (!$isException) { $error = $subject->getError(); $typeLog = $error->code == 'E_FATAL' ? 'fatal' : 'error'; Logger::getInstance()->{$typeLog}(ucfirst($error->type) . ' : ' . $error->message . ' in ' . $error->file . ' on line ' . $error->line, 'error'); } else { $exception = $subject->getException(); Logger::getInstance()->fatal('Exception' . ' : "' . $exception->message . '" in ' . $exception->file . ' on line ' . $exception->line . ' with trace : ' . chr(10) . $exception->trace, 'error'); } }
public function update(SplSubject $errorHandler) { $this->_messages[] = $errorHandler->getError(); }