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

Remove support for legacy Gelf lib

This commit is contained in:
Jordi Boggiano
2016-05-20 19:55:04 +01:00
parent 3e3f44aee4
commit e46fecde34
2 changed files with 5 additions and 11 deletions

View File

@@ -18,7 +18,7 @@
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^5.0", "phpunit/phpunit": "^5.0",
"graylog2/gelf-php": "~1.0", "graylog2/gelf-php": "^1.0.1",
"sentry/sentry": "^0.13", "sentry/sentry": "^0.13",
"ruflin/elastica": ">=0.90 <3.0", "ruflin/elastica": ">=0.90 <3.0",
"doctrine/couchdb": "~1.0@dev", "doctrine/couchdb": "~1.0@dev",

View File

@@ -11,9 +11,7 @@
namespace Monolog\Handler; namespace Monolog\Handler;
use Gelf\IMessagePublisher;
use Gelf\PublisherInterface; use Gelf\PublisherInterface;
use Gelf\Publisher;
use InvalidArgumentException; use InvalidArgumentException;
use Monolog\Logger; use Monolog\Logger;
use Monolog\Formatter\GelfMessageFormatter; use Monolog\Formatter\GelfMessageFormatter;
@@ -33,18 +31,14 @@ class GelfHandler extends AbstractProcessingHandler
protected $publisher; protected $publisher;
/** /**
* @param PublisherInterface|IMessagePublisher|Publisher $publisher a publisher object * @param PublisherInterface $publisher a publisher object
* @param int $level The minimum logging level at which this handler will be triggered * @param int $level The minimum logging level at which this handler will be triggered
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
*/ */
public function __construct($publisher, $level = Logger::DEBUG, $bubble = true) public function __construct(PublisherInterface $publisher, $level = Logger::DEBUG, $bubble = true)
{ {
parent::__construct($level, $bubble); parent::__construct($level, $bubble);
if (!$publisher instanceof Publisher && !$publisher instanceof IMessagePublisher && !$publisher instanceof PublisherInterface) {
throw new InvalidArgumentException('Invalid publisher, expected a Gelf\Publisher, Gelf\IMessagePublisher or Gelf\PublisherInterface instance');
}
$this->publisher = $publisher; $this->publisher = $publisher;
} }