Permalink
Browse files

Merge pull request #235 from fedora-infra/feature/automagick

Automatically tack on the username to the end of logger subtitles.
  • Loading branch information...
2 parents 73dc1b9 + ac1e44f commit 661140485427c53da0888e0dab9f3ca4e5c26cf6 @ralphbean ralphbean committed Mar 6, 2014
Showing with 5 additions and 4 deletions.
  1. +3 −2 fedmsg/meta/logger.py
  2. +2 −2 fedmsg/tests/test_meta.py
View
@@ -30,9 +30,10 @@ class LoggerProcessor(BaseProcessor):
def subtitle(self, msg, **config):
if 'logger.log' in msg['topic']:
if 'log' in msg['msg']:
- return msg['msg']['log']
+ result = msg['msg']['log']
else:
- return self._("<custom JSON message>")
+ result = self._("<custom JSON message>")
+ return result + " (%s)" % msg.get('username', 'none')
else:
return self._("<unhandled log message>")
@@ -163,7 +163,7 @@ class TestAnnouncement(Base):
class TestLoggerNormal(Base):
expected_title = "logger.log"
- expected_subti = 'hello, world.'
+ expected_subti = 'hello, world. (ralph)'
expected_usernames = set(['ralph'])
msg = {
@@ -179,7 +179,7 @@ class TestLoggerNormal(Base):
class TestLoggerJSON(Base):
expected_title = "logger.log"
- expected_subti = '<custom JSON message>'
+ expected_subti = '<custom JSON message> (root)'
expected_usernames = set(['root'])
msg = {

0 comments on commit 6611404

Please sign in to comment.