Skip to content

Commit

Permalink
Fix: better output of Monitor filter
Browse files Browse the repository at this point in the history
  • Loading branch information
gggeek committed Nov 7, 2015
1 parent 482cd38 commit 3cbdaf1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Service/MessageConsumer/EventListener/Monitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function onMessageReceived(MessageReceivedEvent $event)
/// @todo this might give php warnings
/// We could also check if Symfony\Component\VarDumper is available and use it instead...
if (class_exists('Doctrine\Common\Util\Debug')) {
echo "Received a message at " . strftime('%Y/%m/%d - %H:%M:%S', time()) . ": " . \Doctrine\Common\Util\Debug::dump($event->getMessage()) . "\n";
echo "Received a message at " . strftime('%Y/%m/%d - %H:%M:%S', time()) . ": " . \Doctrine\Common\Util\Debug::dump($event->getMessage(), 2, false, false) . "\n";
} else {
echo "Received a message at " . strftime('%Y/%m/%d - %H:%M:%S', time()) . ": " . var_export($event->getMessage(), true) . "\n";
}
Expand All @@ -31,7 +31,7 @@ public function onMessageConsumed(MessageConsumedEvent $event)
/// @todo this might give php warnings
/// We could also check if Symfony\Component\VarDumper is available and use it instead...
if (class_exists('Doctrine\Common\Util\Debug')) {
echo "Message finished consumption at " . strftime('%Y/%m/%d - %H:%M:%S', time()) . ": " . \Doctrine\Common\Util\Debug::dump($event->getConsumptionResult()) . "\n";
echo "Message finished consumption at " . strftime('%Y/%m/%d - %H:%M:%S', time()) . ": " . \Doctrine\Common\Util\Debug::dump($event->getConsumptionResult(), 2, false, false) . "\n";
} else {
echo "Message finished consumption at " . strftime('%Y/%m/%d - %H:%M:%S', time()) . ": " . var_export($event->getConsumptionResult(), true) . "\n";
}
Expand All @@ -42,7 +42,7 @@ public function onMessageConsumptionFailed(MessageConsumptionFailedEvent $event)
/// @todo this might give php warnings
/// We could also check if Symfony\Component\VarDumper is available and use it instead...
if (class_exists('Doctrine\Common\Util\Debug')) {
echo "Message failed consumption at " . strftime('%Y/%m/%d - %H:%M:%S', time()) . ": " . \Doctrine\Common\Util\Debug::dump($event->getException()) . "\n";
echo "Message failed consumption at " . strftime('%Y/%m/%d - %H:%M:%S', time()) . ": " . \Doctrine\Common\Util\Debug::dump($event->getException(), 2, false, false) . "\n";
} else {
echo "Message failed consumption at " . strftime('%Y/%m/%d - %H:%M:%S', time()) . ": " . var_export($event->getException(), true) . "\n";
}
Expand Down
2 changes: 2 additions & 0 deletions news.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* CHANGED: The interfaces ConsumerInterface and MessageInterface have acquired a new method each.
If you have implemented a driver you will need to adapt your code.

* FIXED: the `Monitor` event listener does not dump twice any more the received messages nor strip html tags


# Ver 0.3

Expand Down

0 comments on commit 3cbdaf1

Please sign in to comment.