gracefully handle logs when they are never set up (not sure why this is occurring)

This commit is contained in:
Benjamin Berman 2025-06-18 06:14:09 -07:00
parent f507bec91a
commit d9ee4137c7

View File

@ -5,9 +5,10 @@ import threading
from collections import deque
from datetime import datetime
logs = None
stdout_interceptor = None
stderr_interceptor = None
# initialize with sane defaults
logs = deque(maxlen=1000)
stdout_interceptor = sys.stdout
stderr_interceptor = sys.stderr
class LogInterceptor(io.TextIOWrapper):