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
Nicer default logging format #89845
Comments
The default logging format will print something like: Could it default to something like this instead? 2021-10-31 14:52:36,490 WARNING: Hello Python! logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s') |
Generally, we can't change defaults after an API has been published because it immediately affects the output for people who use that default. However in the case of logging, an argument could be made that changing the default would have less impact. |
Except that people may have used the current basic format in, for example, unit tests, and that code could break after a change like the one proposed. The default has been intentionally kept minimal for the very simplest of needs and it is easy to override this default using e.g. basicConfig() for simple needs or e.g. dictConfig() for more elaborate needs. For those reasons, I don't think this default should be changed. |
They too could pass a format argument themselves rather then relying on the default format never changing. |
Changes to the stdlib shouldn't require changing previously working code (sometimes months or years old) to fix breakage caused by new stdlib changes. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: