Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: logging to file with structlog #3425

Merged
merged 1 commit into from
Apr 28, 2024
Merged

Conversation

peterschutt
Copy link
Contributor

Description

PR fixes issue with converting StructLoggingConfig to dict during call to configure() when the config object has a custom logger factory that references a TextIO object, which cannot be pickled.

Closes

@peterschutt peterschutt requested review from a team as code owners April 24, 2024 23:02
@peterschutt peterschutt added the do not merge Don't merge this label Apr 24, 2024
@JacobCoffee JacobCoffee changed the title fix: logging to file w/ structlog fix: logging to file with structlog Apr 25, 2024
@peterschutt peterschutt removed the do not merge Don't merge this label Apr 25, 2024
Copy link

codecov bot commented Apr 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.27%. Comparing base (edf9400) to head (0c920f0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3425   +/-   ##
=======================================
  Coverage   98.27%   98.27%           
=======================================
  Files         328      328           
  Lines       14851    14852    +1     
  Branches     2357     2357           
=======================================
+ Hits        14595    14596    +1     
  Misses        117      117           
  Partials      139      139           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Fixes issue where adding a file handle to the config object would cause it to fail on call to `configure()`.

- add e2e test for logging to file w/ structlog
@peterschutt peterschutt enabled auto-merge (squash) April 28, 2024 02:43
@peterschutt peterschutt merged commit cc6d55b into main Apr 28, 2024
26 checks passed
@peterschutt peterschutt deleted the structlog-log-to-file branch April 28, 2024 02:47
Copy link

sonarcloud bot commented Apr 28, 2024

Copy link

Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/3425

peterschutt added a commit that referenced this pull request May 1, 2024
fix: structlog file logging

Fixes issue where adding a file handle to the config object would cause it to fail on call to `configure()`.

- add e2e test for logging to file w/ structlog

(cherry picked from commit cc6d55b)
peterschutt added a commit that referenced this pull request May 2, 2024
fix: structlog file logging

Fixes issue where adding a file handle to the config object would cause it to fail on call to `configure()`.

- add e2e test for logging to file w/ structlog

(cherry picked from commit cc6d55b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants