Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
bpo-34356: Fix inconsitent behavior of custom formatters in logging config files #8758
Hello, and thanks for your contribution!
I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).
Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.
When your account is ready, please add a comment in this pull request
You can check yourself
Thanks again for your contribution, we look forward to reviewing it!
Here is an example with Keystone, but other services are using it as well, such as Mistral in our case. I had to create a handler that actually selected a specific formatter and passed
[loggers] keys=root [handlers] keys=custom [formatters] keys= [logger_root] level=WARNING handlers=custom # using a custom handler that includes its own formatter [handler_custom] class=CustomStreamHandler level=INFO args=(sys.stdout,'some formatter stuff')
instead of simply doing this:
[loggers] keys=root [handlers] keys=console [formatters] keys=custom [logger_root] level=WARNING handlers=console # using a standard handler [handler_console] class=StreamHandler level=INFO formatter=custom args=(sys.stdout,) # leaving formatting to the formatter [formatter_custom] format=(%(name)s): %(asctime)s %(levelname)s %(message)s class=my.custom.formatter.MyCustomFormatter args=('some formatter stuff',)
The current implementation is also inconsistent with the way
FYI, I've also signed a CLA.
Just to be clear, do you mean that
I would strongly urge that
I note that you do have a workaround in the form of a custom handler.
Wouldn't this change lead to config files which some versions of Python would silently potentially fail on?
I'm a minor contributor to the OpenStack project and an OpenStack user as well. I contributed on Mistral (workflow orchestration).
You're right for
Thanks for your help.