/** * @see Stream::getMessageFormat() * @param mixed $level * @param array $context * @return string */ protected function getMessageFormat($level, array $context = array()) { $parentFormat = parent::getMessageFormat($level, $context); $consoleFormat = "<{$level}>{$parentFormat}</{$level}>"; return $this->formatter->format($consoleFormat); }
public function testFormatContextRawType() { $resource = fopen('php://memory', 'a'); $stream = new Stream('name', $resource); $stream->setMessageFormat('{message}'); $stream->log(LogLevel::ALERT, '{myvalue}', ['myvalue' => []]); rewind($resource); $logMessage = fgets($resource); $this->assertEquals('array' . PHP_EOL, $logMessage); }