/**
  * @inheritDoc
  */
 public function handle(EventInterface $event)
 {
     if ($event instanceof AfterRouteEvent) {
         $fff = self::fff();
         self::dispatchEvent(new LogEvent(LoggerLevelEnum::INFO(), LoggerTemplate::LOGGER_MESSAGE_RESPONSE_INFO, ['verb' => $fff->get('VERB'), 'pattern' => $fff->get('PATTERN'), 'uri' => $fff->get('URI'), 'response' => ob_get_contents()]));
     }
 }
 /**
  * @inheritDoc
  */
 public function handle(EventInterface $event)
 {
     if ($event instanceof BeforeRouteEvent) {
         $fff = self::fff();
         self::dispatchEvent(new LogEvent(LoggerLevelEnum::INFO(), LoggerTemplate::LOGGER_MESSAGE_REQUEST_INFO, ['verb' => $fff->get('VERB'), 'pattern' => $fff->get('PATTERN'), 'uri' => $fff->get('URI'), 'body' => Utility::instance()->convertUnicodeToUTF8($fff->get('BODY'))]));
     }
 }
 /**
  * @inheritDoc
  */
 public function handle(EventInterface $event)
 {
     if ($event instanceof SecurityFailureEvent) {
         $fff = self::fff();
         //! log
         self::dispatchEvent(new LogEvent(LoggerLevelEnum::ERROR(), LoggerTemplate::LOGGER_MESSAGE_SECURITY_FAILURE, ['security' => get_class($event->getRule()), 'pattern' => $fff->get('PATTERN')]));
         //! error
         self::dispatchEvent($event->getRule()->getErrorEvent());
     }
 }
 /**
  * @inheritDoc
  */
 public function handle(EventInterface $event)
 {
     if ($event instanceof MissingCallbackEvent) {
         $fff = self::fff();
         //! log
         self::dispatchEvent(new LogEvent(LoggerLevelEnum::ERROR(), LoggerTemplate::LOGGER_MESSAGE_JSONP_MISSING_CALLBACK, ['callback' => Utility::instance()->jsonpCallback(), 'verb' => $fff->get('VERB'), 'uri' => $fff->get('URI')]));
         //! error
         self::dispatchEvent(new ErrorEvent(ErrorEnum::ERROR500()));
     }
 }
 /**
  * @inheritDoc
  */
 public function handle(EventInterface $event)
 {
     if ($event instanceof VerbNotAllowedEvent) {
         $fff = self::fff();
         //! log
         self::dispatchEvent(new LogEvent(LoggerLevelEnum::ERROR(), LoggerTemplate::LOGGER_MESSAGE_VERB_NOT_ALLOWED, ['verb' => $fff->get('VERB'), 'pattern' => $fff->get('PATTERN')]));
         //! error
         self::dispatchEvent(new ErrorEvent(ErrorEnum::ERROR405()));
     }
 }
 /**
  * @param LoggerLevelEnum $level
  * @return $this
  */
 public function setLevel(LoggerLevelEnum $level)
 {
     $this->level = (string) $level->getValue();
     return $this;
 }