Fix logging bug

This commit is contained in:
R. Richard 2019-06-27 15:44:23 +02:00 committed by Kristóf Tóth
parent 5f5fc1a8c9
commit c5c5d2c10a

View File

@ -109,10 +109,10 @@ class TFWLogFormatter(Formatter):
def trim(self, value): def trim(self, value):
if isinstance(value, dict): if isinstance(value, dict):
return {k: self.trim(v) for k, v in value.items()} return {k: self.trim(v) for k, v in value.items()}
if isinstance(value, (int, float)): if isinstance(value, str):
return value value_str = str(value)
value_str = str(value) return value_str if len(value_str) <= self.limit else f'{value_str[:self.limit]}...'
return value_str if len(value_str) <= self.limit else f'{value_str[:self.limit]}...' return value
@staticmethod @staticmethod
def fetch_exception_origin(trace): def fetch_exception_origin(trace):