1
0
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:
Jonathan Plantey
2024-11-11 15:34:03 +01:00
committed by GitHub
parent f43e3d5637
commit 5d5da57b81
2 changed files with 31 additions and 18 deletions

View File

@@ -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));
}
/**