-
-
Notifications
You must be signed in to change notification settings - Fork 753
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 default log_config
on uvicorn.run()
#1541
Conversation
Was this the previous default? Where (in what commit) was it changed? |
@@ -478,7 +478,7 @@ def run( | |||
reload_delay: float = 0.25, | |||
workers: typing.Optional[int] = None, | |||
env_file: typing.Optional[str] = None, | |||
log_config: typing.Optional[typing.Union[dict, str]] = None, | |||
log_config: typing.Optional[typing.Union[dict, str]] = LOGGING_CONFIG, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log_config: typing.Optional[typing.Union[dict, str]] = LOGGING_CONFIG, | |
log_config: typing.Optional[typing.Union[typing.Mapping[str, Any], str]] = LOGGING_CONFIG, |
At least this way we'll get an error from the type checker if we try to mutate the default argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to merge #1539 after this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it wouldn't make any difference for here...
Default values were added on: #1423 |
One last thing: should we remove |
The mistake here was to set |
But before if you passed Line 422 in 11d28e2
|
Via CLI it was never supposed to accept Line 399 in 11d28e2
|
Hmm okay ✅ |
I broke the logs because of this. 😞
I don't know how I didn't catch this... It's too simple...
Anyway, moment of shame here. This application doesn't show any logs:
The reason is that I've set the default of
log_config
toNone
, instead ofLOGGING_CONFIG
.EDIT: The funny thing is that I noticed this behavior, and I thought the problem was the computer (mac)... 🤦