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

Load MessageLoggerMiddleware based on logger's effective level #1966

Conversation

josumoreno-BP
Copy link
Contributor

Summary

Fixes #1958

I did an isolated test for this one, but if you think that I should merge this one with test_config_log_level and check there both (level and effective level) let me know.

I've not updated the documentation because I feel that it is not needed for this one.

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.

Copy link
Member

@Kludex Kludex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@josumoreno-BP
Copy link
Contributor Author

Ups, I see that this failed. I only tested it isolated and worked.

I've been checking what is going on to suffer side effects from other tests and the reality is that once a test has loaded the default config I cannot use None as a parameter for uvicorn_logger_level because it will not "override" the existing level (see here). Even trying to set it to None is an error, but in this case passed inadvertent because python ignores it.

So I'm sending an amend removing that None from uvicorn_logger_level parameters.

@josumoreno-BP josumoreno-BP force-pushed the improvement/load-message-logger-middleware-based-on-effective-logger-level branch from e712ee8 to 381b830 Compare May 2, 2023 14:01
@Kludex
Copy link
Member

Kludex commented Jun 1, 2023

Thanks @josumoreno-BP 🙏

@Kludex Kludex merged commit a057ea2 into encode:master Jun 1, 2023
@zanieb zanieb mentioned this pull request Jul 10, 2023
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.

logger.level vs logger.getEffectiveLevel() on config load()
2 participants