ecdavis/pants — Issue #27: Use repr(self) in log messages
Author: ecdavis
Created: 2012-01-13 07:22:23+00:00
State: open
Labels: core

Rather than doing:

log.info("Something happened on %s #%d" % (self.__class__.__name__, self.fileno))

do:

log.info("Something happened on %r" % self)

and simply implement a __repr__ method in _Channel that returns an appropriate identifier string. Avoid using fileno, because it can be None sometimes.