diff --git a/mlair/helpers/datastore.py b/mlair/helpers/datastore.py index d6c977c717c5ef869fdba517fb36fcd55cfe3961..b08c6f45d76ac24f0487fde2ebe5e86e121494af 100644 --- a/mlair/helpers/datastore.py +++ b/mlair/helpers/datastore.py @@ -111,8 +111,15 @@ class TrackParameter: """ Call method of decorator. """ - self.track(*args) - return self.__wrapped__(*args, **kwargs) + name, obj, scope = self.track(*args) + f_name = self.__wrapped__.__name__ + try: + res = self.__wrapped__(*args, **kwargs) + logging.debug(f"{f_name}: {name}({scope})={res if obj is None else obj}") + except Exception as e: + logging.debug(f"{f_name}: {name}({scope})={obj}") + raise + return res def __get__(self, instance, cls): """Create bound method object and supply self argument to the decorated method. <Python Cookbook, p.347>""" @@ -127,6 +134,7 @@ class TrackParameter: tracker[name].append(new_entry) else: tracker[name] = [new_entry] + return name, obj, scope @staticmethod def _decrypt_args(*args):