Skip to content

Bump structlog from 20.1.0 to 25.5.0#312

Merged
wojcikstefan merged 3 commits intomasterfrom
dependabot-pip-structlog-25.5.0
Apr 27, 2026
Merged

Bump structlog from 20.1.0 to 25.5.0#312
wojcikstefan merged 3 commits intomasterfrom
dependabot-pip-structlog-25.5.0

Conversation

@dependabot
Copy link
Copy Markdown
Contributor

@dependabot dependabot Bot commented on behalf of github Oct 28, 2025

Bumps structlog from 20.1.0 to 25.5.0.

Release notes

Sourced from structlog's releases.

25.5.0

Highlights

Huge release! There's plenty of important little bug fixes and new features, but the headliner is definitely the improved ergonomics of structlog.dev.ConsoleRenderer. We have finally accepted that local development has different priorities than production and made it both mutable (with automatic re-configuration) and also easily retrievable (cr = ConsoleRenderer.get_active()). This allows you, for example, to disable Rich exception formatting as easily as structlog.dev.ConsoleRenderer.get_active().exception_formatter = structlog.dev.plain_traceback. Please check out the updated docs!

Full changelog below!

Special Thanks

This release would not be possible without my generous sponsors! Thank you to all of you making sustainable maintenance possible! If you would like to join them, go to https://github.com/sponsors/hynek and check out the sweet perks!

Above and Beyond

Variomedia AG (@variomedia), Tidelift (@tidelift), thanks.dev (@thnxdev), Privacy Solutions GmbH (@privacy-solutions), Quesma (@​QuesmaOrg), FilePreviews (@filepreviews), LambdaTest (@LambdaTest-Inc), Doist (@Doist), Daniel Fortunov (@asqui), and Kevin P. Fleming (@kpfleming).

Maintenance Sustainers

Buttondown (@buttondown), Jeff McCarrell (@jmccarrell), Christopher Dignam (@chdsbd), Magnus Watn (@magnuswatn), David Cramer (@dcramer), Jesse Snyder (@jessesnyder), Rivo Laks (@rivol), Polar (@polarsource), Mike Fiedler (@miketheman), Duncan Hill (@cricalix), Colin Marquardt (@cmarqu), Pieter Swinkels (@swinkels), Nick Libertini (@libertininick), Brian M. Dennis (@crossjam), Celebrity News AG (@celebritynewsag), The Westervelt Company (@westerveltco), Sławomir Ehlert (@slafs), Mostafa Khalil (@khadrawy), Filip Mularczyk (@mukiblejlok), Thomas Klinger (@thmsklngr), Andreas Poehlmann (@ap--), August Trapper Bigelow (@atbigelow), Carlton Gibson (@carltongibson), Roboflow (@roboflow), and Jeff McCarrell (@jmccarrell).

Full Changelog

Deprecated

  • structlog.dev.ConsoleRenderer()'s pad_event argument has been renamed to pad_event_to to differentiate it from the boolean pad_level argument. pad_event is now deprecated.

Added

  • Added structlog.dev.ConsoleRenderer.get_active() that returns the currently active structlog.dev.ConsoleRenderer(). #749

  • structlog.dev.ConsoleRenderer() now supports setting the exception_formatter attribute.

    You can now disable the pretty-printing of exceptions by setting it to structlog.dev.plain_traceback:

    cr = structlog.dev.ConsoleRenderer.get_active()
    cr.exception_formatter = structlog.dev.plain_traceback

    Same goes for sort_keys, columns, colors, force_colors, level_styles, pad_event_to, event_key, timestamp_key, and repr_native_str.

    #749 #756 #757 #759

  • Added structlog.dev.ConsoleRenderer.get_default_column_styles() for reuse the default column styles. #741

  • structlog.testing.capture_logs() now optionally accepts processors to apply before capture. #728

... (truncated)

Changelog

Sourced from structlog's changelog.

25.5.0 - 2025-10-27

Deprecated

  • structlog.dev.ConsoleRenderer()'s pad_event argument has been renamed to pad_event_to to differentiate it from the boolean pad_level argument. pad_event is now deprecated.

Added

  • Added structlog.dev.ConsoleRenderer.get_active() that returns the currently active structlog.dev.ConsoleRenderer(). #749

  • structlog.dev.ConsoleRenderer() now supports setting the exception_formatter attribute.

    You can now disable the pretty-printing of exceptions by setting it to structlog.dev.plain_traceback:

    cr = structlog.dev.ConsoleRenderer.get_active()
    cr.exception_formatter = structlog.dev.plain_traceback

    Same goes for sort_keys, columns, colors, force_colors, level_styles, pad_event_to, event_key, timestamp_key, and repr_native_str.

    #749 #756 #757 #759

  • Added structlog.dev.ConsoleRenderer.get_default_column_styles() for reuse the default column styles. #741

  • structlog.testing.capture_logs() now optionally accepts processors to apply before capture. #728

  • structlog.dev.RichTracebackFormatter now exposes the upstream code_width parameter. Default width is now None for full terminal width. Full terminal width is now handled by Rich itself, bringing support for reflow and COLUMN environment variable. Passing -1 for width is now deprecated and automatically replaced by None. #717

  • Native loggers now allow the passing of a dictionary for dictionary-based interpolation log.info("hello %(name)s!", {"name": "world"}). #748

  • On Python 3.11+, structlog.processors.CallsiteParameterAdder now supports CallsiteParameter.QUAL_NAME that adds the qualified name of the callsite, including scope and class names. This is only available for structlog-originated events since the standard library has no equivalent.

  • structlog.stdlib.LoggerFactory now supports the stacklevel parameter. #763

... (truncated)

Commits

@dependabot dependabot Bot added dependencies Pull requests that update a dependency file python Pull requests that update python code labels Oct 28, 2025
@wojcikstefan
Copy link
Copy Markdown
Member

@dependabot recreate

Bumps [structlog](https://github.com/hynek/structlog) from 20.1.0 to 25.5.0.
- [Release notes](https://github.com/hynek/structlog/releases)
- [Changelog](https://github.com/hynek/structlog/blob/main/CHANGELOG.md)
- [Commits](hynek/structlog@20.1.0...25.5.0)

---
updated-dependencies:
- dependency-name: structlog
  dependency-version: 25.5.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot force-pushed the dependabot-pip-structlog-25.5.0 branch from 0d9a9a4 to 800dc2c Compare April 27, 2026 09:50
@wojcikstefan
Copy link
Copy Markdown
Member

wojcikstefan commented Apr 27, 2026

Reviewed the entire changelog manually. Since it was a lot, I also asked Claude to double-check my thinking. It said:

PR #312 is a dependabot bump of structlog from 20.1.0 to 25.5.0. That's a five-year, semver-major jump. The diff is literally one line in requirements.txt. No code changes.

The good news: socketshark's structlog usage is so vanilla that this is probably fine [emphasis mine since I think this is the key point – we are really boring in our use of structlog in this codebase]. But here's what you should actually give a shit about:

structlog.processors.format_exc_info changed from a plain function to an instance of ExceptionRenderer in 21.2.0. Socketshark passes it as a bare reference in the processor chain at socketshark/__init__.py:46. This still works because ExceptionRenderer is callable, but it's worth knowing the underlying implementation changed.

The TimeStamper with utc=True had a regression where it stopped respecting the UTC flag for custom format strings. Fixed in 25.3.0. Socketshark uses fmt='iso' which is a built-in format, not a custom one, so this likely never bit you — but if anyone downstream was relying on timestamp behavior during the broken window, this changes it back.

ConsoleRenderer now quotes string values containing special characters (25.1.0). Your log output in TTY mode will look slightly different. Not a breakage, but someone staring at logs might notice.

structlog.stdlib.BoundLogger binding methods now return Self instead of BindableLogger (25.2.0). This is a typing change, not a runtime one. If you're running mypy (which CLAUDE.local.md says you do), you might need typing-extensions on Python < 3.11.

Everything else socketshark touches — filter_by_level, add_log_level, add_logger_name, StackInfoRenderer, JSONRenderer, configure() with context_class=dict, LoggerFactory, cache_logger_on_first_use — none of that was deprecated or removed. It's all still there and works the same way.

The context_class parameter is still valid. The threadlocal module was deprecated (22.1.0), but socketshark doesn't use it.

The real risk here is honestly just the sheer size of the jump. Five years of changes with zero code updates means your tests are doing all the heavy lifting. If they pass, you're almost certainly fine. If you don't have good coverage of log output specifically, the formatting differences from ConsoleRenderer and format_exc_info behavioral changes could surprise you in production, but they won't crash anything.

@wojcikstefan wojcikstefan force-pushed the dependabot-pip-structlog-25.5.0 branch 4 times, most recently from e96b3ec to 3b39dd2 Compare April 27, 2026 11:04
The former is easier to namespace and makes the uses of `ANY` more intuitive.
@wojcikstefan wojcikstefan force-pushed the dependabot-pip-structlog-25.5.0 branch from 3b39dd2 to b7e4072 Compare April 27, 2026 11:10
@wojcikstefan wojcikstefan force-pushed the dependabot-pip-structlog-25.5.0 branch from 090da76 to 11f4e6e Compare April 27, 2026 11:13
@wojcikstefan
Copy link
Copy Markdown
Member

wojcikstefan commented Apr 27, 2026

Just to be extra sure, I added a test which confirms structlog logs are emitted correctly (in at least one case). This is good to go now that this test passes.

@wojcikstefan wojcikstefan merged commit 6ab7df8 into master Apr 27, 2026
8 checks passed
@wojcikstefan wojcikstefan deleted the dependabot-pip-structlog-25.5.0 branch April 27, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant