Skip to content

bpo-35722: Specify in the docs that disable_existing_loggers does not affect the root logger#11525

Merged
vsajip merged 3 commits into
python:masterfrom
geryogam:patch-5
Jan 23, 2019
Merged

bpo-35722: Specify in the docs that disable_existing_loggers does not affect the root logger#11525
vsajip merged 3 commits into
python:masterfrom
geryogam:patch-5

Conversation

@geryogam

@geryogam geryogam commented Jan 11, 2019

Copy link
Copy Markdown
Contributor

In the package logging, the parameter disable_existing_loggers used in the functions logging.config.dictConfig and logging.config.fileConfig does not affect the root logger. More precisely, calling those functions with the parameter disable_existing_loggers set to True or False leaves the attribute disabled of the root logger unchanged (while it sets it to True for non-root loggers). So it is either a bug or the documentation should be updated. This PR updates the documentation.

Illustration:

import logging.config

assert logging.getLogger().disabled is False
assert logging.getLogger("foo").disabled is False

logging.config.dictConfig({"version": 1})

assert logging.getLogger().disabled is False
assert logging.getLogger("foo").disabled is True

https://bugs.python.org/issue35722

@bedevere-bot bedevere-bot added docs Documentation in the Doc dir awaiting review labels Jan 11, 2019
@geryogam geryogam changed the title Update the documentation for the parameter disable_existing_loggers bpo-35722: Update the documentation for the parameter disable_existing_loggers Jan 11, 2019
Removed an unrelated change.
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @maggyero for the PR, and @vsajip for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @maggyero for the PR, and @vsajip for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 23, 2019
…s' parameter (pythonGH-11525)

(cherry picked from commit f0c7436)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
@bedevere-bot

Copy link
Copy Markdown

GH-11655 is a backport of this pull request to the 3.7 branch.

@bedevere-bot

Copy link
Copy Markdown

GH-11656 is a backport of this pull request to the 3.6 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 23, 2019
…s' parameter (pythonGH-11525)

(cherry picked from commit f0c7436)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
vsajip pushed a commit that referenced this pull request Jan 23, 2019
…s' parameter (GH-11525) (GH-11655)

(cherry picked from commit f0c7436)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
@geryogam geryogam deleted the patch-5 branch January 23, 2019 10:48
@geryogam geryogam changed the title bpo-35722: Update the documentation for the parameter disable_existing_loggers bpo-35722: Specify in the docs that disable_existing_loggers does not affect the root logger Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants