Commit Graph

6 Commits

Author SHA1 Message Date
octo-patch
579a9263ea fix: guard LogInterceptor.flush() against OSError on Windows no-console setups (fixes #13554)
On Windows, when ComfyUI is launched without an attached console (e.g.
from a desktop shortcut or detached process), sys.__stdout__ may point
to an invalid console handle. Calling flush() on such a handle raises
OSError: [Errno 22] Invalid argument, which propagates up through any
code that calls print() and crashes every prompt execution.

Wrap super().flush() in LogInterceptor.flush() with the same
try/except (OSError, ValueError): pass pattern that is already used
elsewhere in the codebase for exactly this scenario. A failed flush on
a broken console handle just means the line isn't force-drained to that
console; content still reaches log_file and the in-memory log buffers.

Co-Authored-By: Octopus <liyuan851277048@icloud.com>
2026-04-27 10:41:38 +08:00
comfyanonymous
f4411250f3 Repeat frontend version warning at the end.
This way someone running ComfyUI with the command line is more likely to
actually see it.
2025-03-12 07:13:40 -04:00
filtered
9cfd185676
Add option to log non-error output to stdout (#6243)
* nit

* Add option to log non-error output to stdout

- No change to default behaviour
- Adds CLI argument: --log-stdout
- With this arg present, any logging of a level below logging.ERROR will be sent to stdout instead of stderr
2024-12-27 14:40:05 -05:00
pythongosssss
6ee066a14f
Live terminal output (#5396)
* Add /logs/raw and /logs/subscribe for getting logs on frontend
Hijacks stderr/stdout to send all output data to the client on flush

* Use existing send sync method

* Fix get_logs should return string

* Fix bug

* pass no server

* fix tests

* Fix output flush on linux
2024-11-08 19:13:34 -05:00
comfyanonymous
6f021d8aa0 Let --verbose have an argument for the log level. 2024-10-04 10:05:34 -04:00
Chenlei Hu
e91662e784
Get logs endpoint & system_stats additions (#4690)
* Add route for getting output logs

* Include ComfyUI version

* Move to own function

* Changed to memory logger

* Unify logger setup logic

* Fix get version git fallback

---------

Co-authored-by: pythongosssss <125205205+pythongosssss@users.noreply.github.com>
2024-08-30 12:46:37 -04:00