Skip to content

Commit

Permalink
v1.2.13
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmaslanka committed Mar 31, 2021
1 parent 7cb13dc commit 438bbc1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ on GitHub. This file serves to only note what changes
have been made so far, between releases.

# v1.2.13

** bugfix release ** fixed `LoggingFrameTracer`
2 changes: 1 addition & 1 deletion coolamqp/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.2.13a1'
__version__ = '1.2.13'
12 changes: 10 additions & 2 deletions coolamqp/tracing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import logging

from coolamqp.framing.frames import AMQPMethodFrame


class BaseFrameTracer(object):
"""An abstract do-nothing frame tracer"""
Expand Down Expand Up @@ -30,9 +32,15 @@ def __init__(self, logger, log_level=logging.WARNING):

def on_frame(self, timestamp, frame, direction):
if direction == 'to_client':
self.logger.log(self.log_level, 'RECEIVED %s', frame.payload)
if isinstance(frame, AMQPMethodFrame):
self.logger.log(self.log_level, 'RECEIVED METHOD %s', frame.payload)
else:
self.logger.log(self.log_level, 'RECEIVED %s type %s', frame, type(frame))
else:
self.logger.log(self.log_level, 'SENT %s type %s', frame, type(frame))
if isinstance(frame, AMQPMethodFrame):
self.logger.log(self.log_level, 'SENT METHOD %s', frame.payload)
else:
self.logger.log(self.log_level, 'SENT %s type %s', frame, type(frame))


class HoldingFrameTracer(BaseFrameTracer):
Expand Down

0 comments on commit 438bbc1

Please sign in to comment.