Skip to content
Snippets Groups Projects
Commit aeff807b authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

moar logging

parent 90a678a7
No related branches found
No related tags found
No related merge requests found
...@@ -117,7 +117,6 @@ def _compile_particular_content_property_list_class(zpf, fields): ...@@ -117,7 +117,6 @@ def _compile_particular_content_property_list_class(zpf, fields):
def compile_particular_content_property_list_class(zpf, fields): def compile_particular_content_property_list_class(zpf, fields):
q = _compile_particular_content_property_list_class(zpf, fields) q = _compile_particular_content_property_list_class(zpf, fields)
logger.debug('Compiling\n%s', q)
loc = {} loc = {}
exec(q, globals(), loc) exec(q, globals(), loc)
return loc['ParticularContentTypeList'] return loc['ParticularContentTypeList']
......
...@@ -84,6 +84,8 @@ class Connection(object): ...@@ -84,6 +84,8 @@ class Connection(object):
def on_connected(self): def on_connected(self):
"""Called by handshaker upon reception of final connection.open-ok""" """Called by handshaker upon reception of final connection.open-ok"""
logger.info('Connection ready.')
self.state = ST_ONLINE self.state = ST_ONLINE
while len(self.callables_on_connected) > 0: while len(self.callables_on_connected) > 0:
...@@ -107,6 +109,8 @@ class Connection(object): ...@@ -107,6 +109,8 @@ class Connection(object):
else: else:
break break
logger.info('Connected to broker, authentication in progress')
sock.settimeout(0) sock.settimeout(0)
sock.send(b'AMQP\x00\x00\x09\x01') sock.send(b'AMQP\x00\x00\x09\x01')
...@@ -131,6 +135,8 @@ class Connection(object): ...@@ -131,6 +135,8 @@ class Connection(object):
and second time from ListenerThread when socket is disposed of and second time from ListenerThread when socket is disposed of
Therefore we need to make sure callbacks are called EXACTLY once Therefore we need to make sure callbacks are called EXACTLY once
""" """
logger.info('Connection lost')
self.state = ST_OFFLINE # Update state self.state = ST_OFFLINE # Update state
watchlists = [self.watches[channel] for channel in self.watches] watchlists = [self.watches[channel] for channel in self.watches]
...@@ -158,6 +164,8 @@ class Connection(object): ...@@ -158,6 +164,8 @@ class Connection(object):
if isinstance(payload, ConnectionClose): if isinstance(payload, ConnectionClose):
self.send([AMQPMethodFrame(0, ConnectionCloseOk())]) self.send([AMQPMethodFrame(0, ConnectionCloseOk())])
logger.info(u'Broker closed our connection - code %s reason %s', payload.reply_code, payload.reply_text.tobytes().decode('utf8'))
elif isinstance(payload, ConnectionCloseOk): elif isinstance(payload, ConnectionCloseOk):
self.send(None) self.send(None)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment