mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-11 23:54:04 +02:00
Convert level/levelName to enums (#1656)
This commit is contained in:
@@ -15,7 +15,7 @@ use Elasticsearch\ClientBuilder;
|
||||
use Monolog\Formatter\ElasticsearchFormatter;
|
||||
use Monolog\Formatter\NormalizerFormatter;
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Logger;
|
||||
use Monolog\Level;
|
||||
use Elasticsearch\Client;
|
||||
|
||||
class ElasticsearchHandlerTest extends TestCase
|
||||
@@ -56,7 +56,7 @@ class ElasticsearchHandlerTest extends TestCase
|
||||
public function testHandle()
|
||||
{
|
||||
// log message
|
||||
$msg = $this->getRecord(Logger::ERROR, 'log', context: ['foo' => 7, 'bar', 'class' => new \stdClass], datetime: new \DateTimeImmutable("@0"));
|
||||
$msg = $this->getRecord(Level::Error, 'log', context: ['foo' => 7, 'bar', 'class' => new \stdClass], datetime: new \DateTimeImmutable("@0"));
|
||||
|
||||
// format expected result
|
||||
$formatter = new ElasticsearchFormatter($this->options['index'], $this->options['type']);
|
||||
@@ -172,7 +172,7 @@ class ElasticsearchHandlerTest extends TestCase
|
||||
*/
|
||||
public function testHandleIntegration()
|
||||
{
|
||||
$msg = $this->getRecord(Logger::ERROR, 'log', context: ['foo' => 7, 'bar', 'class' => new \stdClass], datetime: new \DateTimeImmutable("@0"));
|
||||
$msg = $this->getRecord(Level::Error, 'log', context: ['foo' => 7, 'bar', 'class' => new \stdClass], datetime: new \DateTimeImmutable("@0"));
|
||||
|
||||
$expected = $msg->toArray();
|
||||
$expected['datetime'] = $msg['datetime']->format(\DateTime::ISO8601);
|
||||
|
Reference in New Issue
Block a user