mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-26 14:20:27 +08:00
Logger should check attributes on current sys.stdout, which may have been overwritten
This commit is contained in:
parent
c1b173e62a
commit
1488f2c59b
@ -57,6 +57,10 @@ def setup_logger(log_level: str = 'INFO', capacity: int = 300, use_stdout: bool
|
|||||||
if logs:
|
if logs:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# workaround for google collab
|
||||||
|
if not hasattr(sys.stdout, "buffer") or not hasattr(sys.stdout, "encoding") or not hasattr(sys.stdout, "line_buffering"):
|
||||||
|
return
|
||||||
|
|
||||||
# Override output streams and log to buffer
|
# Override output streams and log to buffer
|
||||||
logs = deque(maxlen=capacity)
|
logs = deque(maxlen=capacity)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user