mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-05 04:37:38 +02:00
Remove exchangeName usage for AMQP extension users and make PhpAmqpLib use it only if provided, no more default to "log", fixes #355
This commit is contained in:
@@ -32,15 +32,13 @@ class AmqpHandler extends AbstractProcessingHandler
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param AMQPExchange|AMQPChannel $exchange AMQPExchange (php AMQP ext) or PHP AMQP lib channel, ready for use
|
* @param AMQPExchange|AMQPChannel $exchange AMQPExchange (php AMQP ext) or PHP AMQP lib channel, ready for use
|
||||||
* @param string $exchangeName
|
* @param string $exchangeName Optional exchange name, for AMQPChannel (PhpAmqpLib) only
|
||||||
* @param int $level
|
* @param int $level
|
||||||
* @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($exchange, $exchangeName = 'log', $level = Logger::DEBUG, $bubble = true)
|
public function __construct($exchange, $exchangeName = null, $level = Logger::DEBUG, $bubble = true)
|
||||||
{
|
{
|
||||||
if ($exchange instanceof AMQPExchange) {
|
if ($exchange instanceof AMQPChannel) {
|
||||||
$exchange->setName($exchangeName);
|
|
||||||
} elseif ($exchange instanceof AMQPChannel) {
|
|
||||||
$this->exchangeName = $exchangeName;
|
$this->exchangeName = $exchangeName;
|
||||||
} else {
|
} else {
|
||||||
throw new \InvalidArgumentException('PhpAmqpLib\Channel\AMQPChannel or AMQPExchange instance required');
|
throw new \InvalidArgumentException('PhpAmqpLib\Channel\AMQPChannel or AMQPExchange instance required');
|
||||||
|
Reference in New Issue
Block a user