Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bdf3e1e

Browse filesBrowse files
committed
Fix incorrect dictConfig example
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
1 parent 2c4ec63 commit bdf3e1e
Copy full SHA for bdf3e1e

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed

‎docs/writing/logging.rst

Copy file name to clipboardExpand all lines: docs/writing/logging.rst
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ the configuration dictionary.
163163
'formatter': 'f',
164164
'level': logging.DEBUG}
165165
},
166-
loggers = {
167-
'root': {'handlers': ['h'],
168-
'level': logging.DEBUG}
169-
}
166+
root = {
167+
'handlers': ['h'],
168+
'level': logging.DEBUG,
169+
},
170170
)
171171
172172
dictConfig(logging_config)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.