1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-20 20:09:11 +00:00

framework/instruments: add ManagedCallback __repr__

Add a __repr__ for ManagedCallback callback to prove a useful
representation in logging.
This commit is contained in:
Sergei Trofimov 2018-01-25 08:37:33 +00:00 committed by Marc Bonnici
parent 1101c358d0
commit fc56de8842

View File

@ -280,6 +280,12 @@ class ManagedCallback(object):
else:
raise
def __repr__(self):
text = 'ManagedCallback({}, {})'
return text.format(self.instrument.name, self.callback.im_func.func_name)
__str__ = __repr__
# Need this to keep track of callbacks, because the dispatcher only keeps
# weak references, so if the callbacks aren't referenced elsewhere, they will