Commit Graph

2 Commits

Author SHA1 Message Date
RUiNtheExtinct
c06b18a014 fix(logger): clear logs after all callbacks, not inside loop
Move _logs_since_flush reset outside the callback loop so all
registered callbacks receive the same log data instead of only
the first callback getting logs while subsequent ones get an empty list.

Add test to verify multiple callbacks all receive the same logs.
2025-12-28 13:31:45 +05:30
RUiNtheExtinct
e86ffb0ea6 fix(logger): handle OSError errno 22 on flush for Windows piped streams
When running ComfyUI in API mode on Windows, print() statements from
custom nodes can crash with "OSError: [Errno 22] Invalid argument"
during flush. This occurs because piped/redirected stdout streams on
Windows may fail to flush even after successful writes.

This fix catches OSError with errno 22 (EINVAL) specifically in
LogInterceptor.flush(), allowing the flush callbacks to still execute.
The error is safe to ignore since write() already succeeded.

Fixes #11367
2025-12-28 13:29:27 +05:30