Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
6bc46485
Commit
6bc46485
authored
Jan 21, 2008
by
Vinay Sajip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor documentation change - hyperlink tidied up.
parent
9587a7a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
Doc/library/logging.rst
Doc/library/logging.rst
+8
-5
No files found.
Doc/library/logging.rst
View file @
6bc46485
...
...
@@ -1199,13 +1199,13 @@ also illustrates what dict-like behaviour is needed from an arbitrary
"dict-like"
object
for
use
in
the
constructor
::
import
logging
class
ConnInfo
:
"""
An example class which shows how an arbitrary class can be used as
the 'extra' context information repository passed to a LoggerAdapter.
"""
def
__getitem__
(
self
,
name
):
"""
To allow this instance to look like a dict.
...
...
@@ -1218,7 +1218,7 @@ also illustrates what dict-like behaviour is needed from an arbitrary
else
:
result
=
self
.
__dict__
.
get
(
name
,
"?"
)
return
result
def
__iter__
(
self
):
"""
To allow iteration over keys, which will be merged into
...
...
@@ -1227,7 +1227,7 @@ also illustrates what dict-like behaviour is needed from an arbitrary
keys
=
[
"ip"
,
"user"
]
keys
.
extend
(
self
.
__dict__
.
keys
())
return
keys
.
__iter__
()
if
__name__
==
"__main__"
:
from
random
import
choice
levels
=
(
logging
.
DEBUG
,
logging
.
INFO
,
logging
.
WARNING
,
logging
.
ERROR
,
logging
.
CRITICAL
)
...
...
@@ -2163,7 +2163,10 @@ LoggerAdapter Objects
.. versionadded:: 2.6
:class:`LoggerAdapter` instances are used to conveniently pass contextual
information into logging calls. For a usage example , see context-info_.
information into logging calls. For a usage example , see the section on
`adding contextual information to your logging output`__.
__ context-info_
.. class:: LoggerAdapter(logger, extra)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment