mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-10 07:06:40 +02:00
Allow for both mlehner/gelf-php and graylog2/gelf-php usage
This commit is contained in:
@@ -19,7 +19,7 @@ class GelfMessageFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
public function setUp()
|
||||
{
|
||||
if (!class_exists('\Gelf\Message')) {
|
||||
$this->markTestSkipped("graylog2/gelf-php not installed");
|
||||
$this->markTestSkipped("graylog2/gelf-php or mlehner/gelf-php is not installed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ class GelfMessageFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('meh', $message->getFacility());
|
||||
$this->assertEquals(null, $message->getLine());
|
||||
$this->assertEquals(null, $message->getFile());
|
||||
$this->assertEquals(3, $message->getSyslogLevel());
|
||||
$this->assertEquals($this->isLegacy() ? 3 : 'error', $message->getLevel());
|
||||
$this->assertNotEmpty($message->getHost());
|
||||
|
||||
$formatter = new GelfMessageFormatter('mysystem');
|
||||
@@ -184,4 +184,9 @@ class GelfMessageFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertArrayHasKey('_EXTkey', $message_array);
|
||||
$this->assertEquals('pair', $message_array['_EXTkey']);
|
||||
}
|
||||
|
||||
private function isLegacy()
|
||||
{
|
||||
return interface_exists('\Gelf\IMessagePublisher');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user