Skip to content

Fix incorrect dictConfig example#704

Merged
sigmavirus24 merged 1 commit into
realpython:masterfrom
ForeverWintr:master
May 11, 2016
Merged

Fix incorrect dictConfig example#704
sigmavirus24 merged 1 commit into
realpython:masterfrom
ForeverWintr:master

Conversation

@ForeverWintr
Copy link
Copy Markdown
Contributor

dictConfig expects a special root key outside of the loggers subdictionary in order to configure the root logger. I've tried the existing example code on python 2.7.5 and 3.5.1, and in neither case does the final log line produce any output (because the root logger remains set to looging.WARN by default).

Changing the example to use the root key causes the log message to appear properly.

The root key is explained in PEP391: https://www.python.org/dev/peps/pep-0391/#dictionary-schema-detail

dictConfig expects a special `root` key outside of the `loggers` subdictionary in order to configure the root logger. I've tried the existing example code on python 2.7.5 and 3.5.1, and in neither case does the final log line produce any output (because the root logger remains set to `looging.WARN` by default). 

Changing the example to use the `root` key causes the log message to appear properly.

The `root` key is explained in PEP391: https://www.python.org/dev/peps/pep-0391/#dictionary-schema-detail
@sigmavirus24 sigmavirus24 merged commit b620def into realpython:master May 11, 2016
Sign up for free to 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.

2 participants