mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-17 18:36:32 +02:00
Normalize call normalizeRecord if necessary (#1906)
* Normalize call normalizeRecord if necessary * Update patch to always go through format() * Update JsonFormatterTest.php * Fix implementation * Fix test expectations * Update JsonFormatter.php --------- Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
This commit is contained in:
@@ -89,7 +89,8 @@ class JsonFormatterTest extends TestCase
|
||||
$this->getRecord(Level::Warning),
|
||||
$this->getRecord(Level::Debug),
|
||||
];
|
||||
$this->assertEquals(json_encode($records), $formatter->formatBatch($records));
|
||||
$expected = array_map(fn (LogRecord $record) => json_encode($record->toArray(), JSON_FORCE_OBJECT), $records);
|
||||
$this->assertEquals('['.implode(',', $expected).']', $formatter->formatBatch($records));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user