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

add log() to BoundLoggerFiltering* #413

Merged
merged 3 commits into from
Apr 26, 2022
Merged

add log() to BoundLoggerFiltering* #413

merged 3 commits into from
Apr 26, 2022

Conversation

FlorianLudwig
Copy link
Contributor

@FlorianLudwig FlorianLudwig commented Apr 21, 2022

Summary

add log() to BoundLoggerFiltering* to better match BoundLogger signature

Pull Request Check List

  • Added tests for changed code.
    • The CI fails with less than 100% coverage.
  • [?] New APIs are added to typing_examples.py (not actually new, just fixes stdlib.get_logger().log())
  • Updated documentation for changed code.
    • I think no documentation update is needed for this addition
    • New functions/classes have to be added to docs/api.rst by hand.
    • Changed/added classes/methods/functions have appropriate versionadded, versionchanged, or deprecated directives.
      Find the appropriate next version in our __init__.py file.
  • Documentation in .rst and .md files is written using semantic newlines.
  • Changes (and possible deprecations) are documented in the changelog.
  • Consider granting push permissions to the PR branch, so maintainers can fix minor issues themselves without pestering you.

@hynek
Copy link
Owner

hynek commented Apr 23, 2022

When you say BoundLogger, I presume you mean stdlib's one (yes, calling them all same was stupid)?

There's really no guarantee to mirror stdlib APIs in general, do you find that method practically useful and if so how? Because it completely obliterates the performance gains we got by pre-creating concrete classes.

@FlorianLudwig
Copy link
Contributor Author

When you say BoundLogger, I presume you mean stdlib's one (yes, calling them all same was stupid)?

Indeed. I like using structlog.stdlib.get_logger for the type hints.

There's really no guarantee to mirror stdlib APIs in general, do you find that method practically useful and if so how?

I use it to pipe stdlib logs into structlog.

Because it completely obliterates the performance gains we got by pre-creating concrete classes.

It should only effect performance for calls that use .log but the .info etc should be still the same performance, right?

@hynek hynek merged commit 5cb5f8c into hynek:main Apr 26, 2022
@hynek
Copy link
Owner

hynek commented Apr 26, 2022

OK thanks! I'll fix a few tiny quibbles myself, really weird to document this. 🤔

hynek added a commit that referenced this pull request Apr 26, 2022
@tjb9dc
Copy link

tjb9dc commented May 17, 2022

@hynek would you mind cutting a release that has this PR? Thanks!

@hynek
Copy link
Owner

hynek commented May 21, 2022

I plan on pushing 22.1 once #407 is merged.

sscherfke pushed a commit to sscherfke/structlog that referenced this pull request May 21, 2022
Co-authored-by: Hynek Schlawack <hs@ox.cx>
sscherfke pushed a commit to sscherfke/structlog that referenced this pull request May 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants