minimumErrorLevel = defined('TESTS_ERROR_LOG_LISTENER_LEVEL') ? TESTS_ERROR_LOG_LISTENER_LEVEL : -1; parent::__construct($name, $handlers, $processors); } /** * @return void */ public function clearMessages() { $this->messages = []; } /** * @return array */ public function getMessages() { return $this->messages; } /** * @{inheritDoc} * * @param integer $level The logging level * @param string $message The log message * @param array $context The log context * @return Boolean Whether the record has been processed */ public function addRecord($level, $message, array $context = []) { if ($level <= $this->minimumErrorLevel) { $this->messages[] = [ 'level' => $this->getLevelName($level), 'message' => $message, ]; } return parent::addRecord($level, $message, $context); } }