Skip to content

bpo-43858: Add logging.getLevelNamesMapping() - #26459

Merged
miss-islington merged 12 commits into
python:mainfrom
akulakov:43858-add-logging-getLevelNamesDict
Jun 3, 2021
Merged

bpo-43858: Add logging.getLevelNamesMapping()#26459
miss-islington merged 12 commits into
python:mainfrom
akulakov:43858-add-logging-getLevelNamesDict

Conversation

@akulakov

@akulakovakulakov commented May 31, 2021

Copy link
Copy Markdown
Contributor

Added a function that returns a copy of a dict of logging levels.

https://bugs.python.org/issue43858

@ericvsmithericvsmith left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This needs tests. In particular it should add tests that a copy is returned.

Comment threadDoc/library/logging.rst Outdated
Comment threadLib/logging/__init__.py Outdated
@bedevere-bot

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@akulakov

Copy link
Copy Markdown
ContributorAuthor

I have made the requested changes; please review again

@bedevere-bot

Copy link
Copy Markdown

Thanks for making the requested changes!

@ericvsmith: please review the changes made to this pull request.

@ericvsmithericvsmith left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is looking good to me. @vsajip : I'll let you have the final word.

Comment threadDoc/library/logging.rst Outdated
Comment threadLib/test/test_logging.py Outdated
Comment threadDoc/library/logging.rst Outdated
@bedevere-bot

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Comment threadLib/test/test_logging.py Outdated
@@ -0,0 +1 @@
Added a function that returns a copy of a dict of logging levels: func::`logging.getLevelNamesMapping()`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Now that I look at this: isn't the correct syntax:

:func:`logging.getLevelNamesMapping`

?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

You are right, well spotted!

@akulakov

Copy link
Copy Markdown
ContributorAuthor

@vsajip@ericvsmith Pushed an update per comments, please take a look!

@ericvsmithericvsmith left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

With the one small item I mentioned, this looks good to me.

@@ -0,0 +1 @@
Added a function that returns a copy of a dict of logging levels: :func:`logging.getLevelNamesMapping()`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

My understanding is that :func: adds the parens, so you should leave them off in this message. I've looked at other files, and they don't have the parens.

@akulakov

Copy link
Copy Markdown
ContributorAuthor

@ericvsmith I fixed the parens, please take a look..

@vsajipvsajip left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Accidental double-definition in test?

Comment threadLib/test/test_logging.py Outdated
self.assertEqual(rc, 1)

def test_get_level_names_mapping(self):
def test_get_level_names_mapping(self):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think you meant this double level of indentation! That causes the test to do nothing effective 😞

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Whoops, somehow doubling made it hard to spot for me..

@akulakov

Copy link
Copy Markdown
ContributorAuthor

@vsajip Fixed the doubled test..

@ericvsmithericvsmith left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This all looks good to me. Thanks, @akulakov !

@akulakovakulakov changed the title bpo-43858: Add logging.getLevelNamesDict()bpo-43858: Add logging.getLevelNamesMapping()Jun 2, 2021
@akulakov

Copy link
Copy Markdown
ContributorAuthor

@ericvsmith and @vsajip much thanks for the help with the PR!

Sign up for freeto 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.

6 participants

@akulakov@bedevere-bot@vsajip@ericvsmith@the-knights-who-say-ni@miss-islington