mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-06 05:07:36 +02:00
Make sure flowdock handler is configured correctly, fixes #597
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
namespace Monolog\Handler;
|
namespace Monolog\Handler;
|
||||||
|
|
||||||
use Monolog\Logger;
|
use Monolog\Logger;
|
||||||
|
use Monolog\Formatter\FlowdockFormatter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends notifications through the Flowdock push API
|
* Sends notifications through the Flowdock push API
|
||||||
@@ -48,6 +49,28 @@ class FlowdockHandler extends SocketHandler
|
|||||||
$this->apiToken = $apiToken;
|
$this->apiToken = $apiToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function setFormatter(FormatterInterface $formatter)
|
||||||
|
{
|
||||||
|
if (!$formatter instanceof FlowdockFormatter) {
|
||||||
|
throw new \InvalidArgumentException('The FlowdockHandler requires an instance of Monolog\Formatter\FlowdockFormatter to function correctly');
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent::setFormatter($formatter);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the default formatter.
|
||||||
|
*
|
||||||
|
* @return FormatterInterface
|
||||||
|
*/
|
||||||
|
protected function getDefaultFormatter()
|
||||||
|
{
|
||||||
|
throw new \InvalidArgumentException('The FlowdockHandler must be configured (via setFormatter) with an instance of Monolog\Formatter\FlowdockFormatter to function correctly');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user