bastimeyer · GitHub

@bastimeyer

Merged

@bastimeyer

@bastimeyer

Add support for capturing warnings and logging them via Streamlink's
root logger on the warning log level. Use custom `WarningLogRecord`s
with a custom warning message format, and replace the record's
logger name with "warnings" and use the name of the warning type
as log level name when showing warnings.
This enables having proper `DeprecationWarning`s and `FutureWarning`s
in the code instead of just using the logger and its warning log level,
and those warnings can be filtered via the regular filtering mechanisms.
For example:
```
[warnings][deprecationwarning] Calling this method is deprecated
[warnings][futurewarning] Using this config file path is deprecated
```
- Replace all deprecation warning log messages with `FutureWarning`s
- Fix deprecated session options in tests
- Update and fix tests

@bastimeyer

- Add `StreamlinkWarning` and `StreamlinkDeprecationWarning`
  and replace `FutureWarning`s
- Don't include the warning's origin in the warning logger if it's a
  subclass of `StreamlinkWarning`
- Update tests

@bastimeyer

@gravyboat

@bastimeyer

snorkelopstesting4-web pushed a commit to snorkel-marlin-repos/streamlink_streamlink_pr_5072_8b5da3eb-6fda-4ae9-a95b-17ec7a2e33ca that referenced this pull request

Oct 22, 2025

Shallow Copy Bot

Merged

snorkelopstesting1-a11y added a commit to snorkel-marlin-repos/streamlink_streamlink_pr_5072_8b5da3eb-6fda-4ae9-a95b-17ec7a2e33ca that referenced this pull request

Oct 22, 2025

Read the original on github.com ↗