Skip to content

Commit 6ff26b0

Browse files
committed
fix: error during logging shutdown
1 parent 03a46ec commit 6ff26b0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

freqtrade/loggers/ft_rich_handler.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ def emit(self, record):
2121
msg = self.format(record)
2222
# Format log message
2323
log_time = Text(
24-
datetime.fromtimestamp(record.created).strftime("%Y-%m-%d %H:%M:%S,%f")[:-3],
24+
datetime.fromtimestamp(record.created).strftime("%Y-%m-%d %H:%M:%S,%f")[:-3]
25+
if record.created
26+
else "N/A",
2527
)
2628
name = Text(record.name, style="violet")
2729
log_level = Text(record.levelname, style=f"logging.level.{record.levelname.lower()}")
@@ -40,5 +42,8 @@ def emit(self, record):
4042

4143
except RecursionError:
4244
raise
45+
except ImportError:
46+
# Error when shutting down the console...
47+
pass
4348
except Exception:
4449
self.handleError(record)

0 commit comments

Comments
 (0)