diff options
author | Théo de la Hogue | 2024-03-22 11:11:49 +0100 |
---|---|---|
committer | Théo de la Hogue | 2024-03-22 11:11:49 +0100 |
commit | cc9d6032cf46db24b9a221171c84aa06430bfe7c (patch) | |
tree | 99aa88635443b650468acb2710f35bdf105e3fb0 | |
parent | 78c27a75e91858786549fb1498ee3d866ce4acef (diff) | |
download | argaze-cc9d6032cf46db24b9a221171c84aa06430bfe7c.zip argaze-cc9d6032cf46db24b9a221171c84aa06430bfe7c.tar.gz argaze-cc9d6032cf46db24b9a221171c84aa06430bfe7c.tar.bz2 argaze-cc9d6032cf46db24b9a221171c84aa06430bfe7c.tar.xz |
Improving logging in __str__ method.
-rw-r--r-- | src/argaze/DataFeatures.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/argaze/DataFeatures.py b/src/argaze/DataFeatures.py index b6105e4..c435560 100644 --- a/src/argaze/DataFeatures.py +++ b/src/argaze/DataFeatures.py @@ -785,7 +785,9 @@ class PipelineStepObject(): Returns: String representation """ - + + logging.debug('%s.__str__ %s', type(self).__name__, self.name if self.name is not None else '') + tabs = self.tabulation output = f'{Fore.GREEN}{Style.BRIGHT}{self.__class__.__module__}.{self.__class__.__name__}{Style.RESET_ALL}\n' @@ -802,6 +804,8 @@ class PipelineStepObject(): for name, value in self.properties: + logging.debug('%s@property %s (%s)', type(self).__name__, name, type(value).__name__) + output += f'{tabs}\t{Style.BRIGHT}{name}{Style.RESET_ALL}: ' if type(value) == dict: @@ -812,7 +816,7 @@ class PipelineStepObject(): output += f'{tabs}\t - {Fore.MAGENTA}{k}{Style.RESET_ALL}: {v}\n' - if type(value) == list: + elif type(value) == list: output += '\n' @@ -836,6 +840,8 @@ class PipelineStepObject(): except TypeError as e: + logging.error('%s@property %s (%s)', type(self).__name__, name, type(value).__name__) + output += f'{Fore.RED}{Style.BRIGHT}!!! {type(self).__name__}.{name}: {e}{Style.RESET_ALL}\n\n' if output[-1] != '\n': |