-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dummy messenger should log the messages #543
Dummy messenger should log the messages #543
Conversation
fe45dea
to
eee5e9c
Compare
|
||
def send_message(self, topic, msg): | ||
pass | ||
logger.info('Sending to %s:\n%s' % (topic, json.dumps(msg, sort_keys=True, indent=2))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't msg
already string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, it is. That will have to change probably.
For some messaging backends it may not be necessary to do the encoding (e.g. fedmsg), and it's simpler when creating the message.
Instead of ignoring them all, it should log them. This can be easily disabled in the LOGGING settings by adding following snippet: 'pdc.apps.utils.messaging': { 'level': 'WARNING', } JIRA: PDC-2583
I added another commit that encodes the message to JSON only in the messenger. This saves us the parsing in Fedmsg, and will be needed for UMB to construct the headers based on message data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
Instead of ignoring them all, it should log them. This can be easily disabled in the LOGGING settings by adding following snippet:
JIRA: PDC-2583