1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-10 23:24:02 +02:00

Do not include message levels if it is already included in tag

This commit is contained in:
fordnox
2015-11-15 21:23:25 +02:00
parent 6abfc22762
commit 034e895a6d
2 changed files with 25 additions and 8 deletions

View File

@@ -35,18 +35,26 @@ class FluentdFormatterTest extends TestCase
*/
public function testFormat()
{
$record = $this->getRecord(Logger::WARNING);
$record['datetime'] = new \DateTime("@0");
$formatter = new FluentdFormatter();
$this->assertEquals(
'["test", 0, {"message":"test","level":300,"level_name":"WARNING","extra":[]}]',
'["test", 0, {"message":"test","extra":[],"level":300,"level_name":"WARNING"}]',
$formatter->format($record));
}
/**
* @covers Monolog\Formatter\FluentdFormatter::format
*/
public function testFormatWithTag()
{
$record = $this->getRecord(Logger::ERROR);
$record['datetime'] = new \DateTime("@0");
$formatter = new FluentdFormatter(true);
$this->assertEquals(
'["test.warning", 0, {"message":"test","level":300,"level_name":"WARNING","extra":[]}]',
'["test.error", 0, {"message":"test","extra":[]}]',
$formatter->format($record));
}
}