- Raise `OSError` instead of returning `None` on error - Check for valid input and output streams when prompting the user - Pass-through `KeyboardInterrupt` - Fix typing - Update tests
Allow the primary output stream to be `None`: Users should be able to disable console output as a whole via `--quiet` (upcoming changes). Use a secondary stream for writing messages into a file: Inherit the `--logfile` stream from the filehandler of Streamlink's root logger (upcoming changes), but skip it if it's a TTY stream, so `--logfile=/dev/stdout` doesn't result in log message duplication.
When `--logfile=file` is set, write console output messages both to the default output stream and the log file stream instead of overriding the console output stream with the log file stream. Log messages will still follow the log file stream, if `--logfile=file` is set, and won't appear on the default output stream, just like before. If `--logfile=/dev/tty` (and similar) is set, ignore the log file stream on the `ConsoleOutput`, so messages won't be duplicated. Refactor and split up `setup_logger_and_logger()` into `setup_console()` and `setup_logger()`. Add `silent_log` attribute on the `args` object (`argparse.Namespace`).
Before creating the `StreamHandler`, check if `stream` exists, rather than letting the stdlib check for its existence when initializing the handler object and falling back to `stderr`. If the passed stream does not exist, then don't attach any handlers to the root logger and prevent logging this way instead of using a devnull `FileHandler` if `stderr` also does not exist.
Let the `ConsoleOutput` use `stderr` if `stdout` does not exist. Since Streamlink's root logger inherits the `ConsoleOutput` stream, the fallback mechanism is also inherited (see previous commit).
snorkelopstesting4-web pushed a commit to snorkel-marlin-repos/streamlink_streamlink_pr_6461_aafaa27f-587c-4f44-9941-514b5bdc0c99 that referenced this pull request
Oct 22, 2025
Merged
snorkelopstesting4-web added a commit to snorkel-marlin-repos/streamlink_streamlink_pr_6461_aafaa27f-587c-4f44-9941-514b5bdc0c99 that referenced this pull request
Oct 22, 2025