Permalink
Browse files

allow a callable no-arg prefix for the debugger (#235)

This could be useful for, for example, printing a timestamp
  • Loading branch information...
ke4roh authored and prologic committed Oct 13, 2017
1 parent 1327b29 commit cdd4f1ac9ba58e3bc6b629ac076758f404e4ccc6
Showing with 4 additions and 1 deletion.
  1. +4 −1 circuits/core/debugger.py
@@ -113,7 +113,10 @@ def _on_event(self, event, *args, **kwargs):
s = repr(event)
if self.prefix:
s = "%s: %s" % (self.prefix, s)
if hasattr(self.prefix, '__call__'):
s = "%s: %s" % (self.prefix(), s)
else:
s = "%s: %s" % (self.prefix, s)
if self.trim:
s = "%s ...>" % s[:self.trim]

0 comments on commit cdd4f1a

Please sign in to comment.