From 4cadf3c06a163781e6cc99eea7bc94dfcd8ccb9b Mon Sep 17 00:00:00 2001 From: Federico Sismondi Date: Thu, 11 Jan 2018 15:13:46 +0100 Subject: [PATCH] cleaner prints --- event_bus_utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/event_bus_utils.py b/event_bus_utils.py index adbc768..25d821e 100644 --- a/event_bus_utils.py +++ b/event_bus_utils.py @@ -59,7 +59,10 @@ class AmqpListener(threading.Thread): @classmethod def default_message_handler(cls, message_as_dict): clean_dict = dict((k, v) for k, v in message_as_dict.items() if v) - print(json.dumps(clean_dict, indent=4)) + print('-'*120) + print(' %s : %s *' %('routing_key',clean_dict.pop('routing_key'))) + print('-' * 120) + print(json.dumps(clean_dict, indent=4, sort_keys=True)) def amqp_connect(self): self.connection = pika.BlockingConnection(pika.URLParameters(self.amqp_url)) -- 2.24.1