Bugfixes in logger

This commit is contained in:
Sven Heidemann 2020-11-27 18:12:09 +01:00
parent e76b293f60
commit 0df6d469ab
2 changed files with 3 additions and 3 deletions

View File

@ -146,9 +146,9 @@ class Logger(LoggerBase):
if ex is not None:
tb = traceback.format_exc()
self.error(name, message)
output = self._get_string(name, LoggingLevel.ERROR, f'{ex} -> {tb}')
output = self._get_string(name, LoggingLevel.FATAL, f'{ex} -> {tb}')
else:
output = self._get_string(name, LoggingLevel.ERROR, message)
output = self._get_string(name, LoggingLevel.FATAL, message)
# check if message can be written to log
if self._level.value >= LoggingLevel.FATAL.value:

View File

@ -210,4 +210,4 @@ class LoggerTest(unittest.TestCase):
print('Cannot open log file', e)
self.assertGreater(len(log_content), 0)
self.assertTrue(log_content[len(log_content) - 1].endswith(f'[ ERROR ] [ {__name__} ]: {__name__}.test_fatal:\n'))
self.assertTrue(log_content[len(log_content) - 1].endswith(f'[ FATAL ] [ {__name__} ]: {__name__}.test_fatal:\n'))