Skip to content

gh-93162: Allow passing instances of logging objects to logging.dictConfig #93163

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

Closed
wants to merge 2 commits into from
Closed

Conversation

spacemanspiff2007
Copy link
Contributor

@spacemanspiff2007 spacemanspiff2007 commented May 24, 2022

Allow passing objects.
PR for #93162

@spacemanspiff2007 spacemanspiff2007 requested a review from vsajip as a code owner May 24, 2022 09:20
@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@@ -647,6 +647,9 @@ def configure(self):

def configure_formatter(self, config):
"""Configure a formatter from a dictionary."""
if isinstance(config, logging.Formatter):
return config

if '()' in config:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using '()' would be more consistent with handler configuration but then the entry in the dict is just

{
    '()': my_object
}

Copy link
Member

Choose a reason for hiding this comment

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

Doesn't that work?

@vsajip
Copy link
Member

vsajip commented May 24, 2022

Closing, as an approach has been proposed in the issue which eliminates the need for any changes to logging for this requirement.

@vsajip vsajip closed this May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants