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
c048c612
Commit
c048c612
authored
Feb 10, 2011
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an entry for logging.
parent
f9d0ea30
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
2 deletions
+39
-2
Doc/whatsnew/3.2.rst
Doc/whatsnew/3.2.rst
+39
-2
No files found.
Doc/whatsnew/3.2.rst
View file @
c048c612
...
...
@@ -1140,6 +1140,44 @@ decorator, :func:`~reprlib.recursive_repr`, for detecting recursive calls to
(Contributed by Raymond Hettinger in :issue:`9826` and :issue:`9840`.)
logging
-------
In addition to dictionary based configuration described above, the
:mod:`logging` package has many other improvements.
The logging documentation has been augmented by a :ref:`basic tutorial
<logging-basic-tutorial>`\, an :ref:`advanced tutorial
<logging-advanced-tutorial>`\, and a :ref:`cookbook <logging-cookbook>` of
logging recipes. These documents are the fastest way to learn about logging.
The :func:`logging.basicConfig` set-up function gained a *style* argument to
support three different types of string formatting. It defaults to "%" for
traditional %-formatting, can be set to "{" for the new :meth:`str.format` style, or
can be set to "$" for the shell-style formatting provided by
:class:`string.Template`. The following three configurations are equivalent::
>>> from logging import basicConfig
>>> basicConfig(style='%', format="%(name)s -> %(levelname)s: %(message)s")
>>> basicConfig(style='{', format="{name} -> {levelname} {message}")
>>> basicConfig(style='$', format="$name -> $levelname: $message")
If no configuration is set-up before a logging event occurs, there is now a
default configuration using a :class:`~logging.StreamHandler` directed to
:attr:`sys.stderr` for events of ``WARNING`` level or higher. Formerly, an
event occurring before a configuration was set-up would either raise an
exception or silently drop the event depending on the value of
:attr:`logging.raiseExceptions`. The new default handler is stored in
:attr:`logging.lastResort`.
The use of filters has been simplified. Instead of creating a
:class:`~logging.Filter` object, the predicate can be any Python callable that
returns *True* or *False*.
There were a number of other improvements that add flexibility and simplify
configuration. See the module documentation for a full listing of changes in
Python 3.2.
csv
---
...
...
@@ -2127,8 +2165,7 @@ reading directly from dictionaries and strings.
(All changes contributed by Łukasz Langa.)
.. XXX show a difflib example
.. XXX add entry for logging changes other than the dict config pep
.. XXX consider showing a difflib example
urllib.parse
------------
...
...
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