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
40d9a4e8
Commit
40d9a4e8
authored
Aug 30, 2010
by
Vinay Sajip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved logging.Formatter date/time formatting documentation.
parent
33a29942
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
Doc/library/logging.rst
Doc/library/logging.rst
+8
-0
Lib/logging/__init__.py
Lib/logging/__init__.py
+5
-1
No files found.
Doc/library/logging.rst
View file @
40d9a4e8
...
...
@@ -319,6 +319,14 @@ order::
"%(asctime)s - %(levelname)s - %(message)s"
Formatters
use
a
user
-
configurable
function
to
convert
the
creation
time
of
a
record
to
a
tuple
.
By
default
,
:
func
:`
time
.
localtime
`
is
used
;
to
change
this
for
a
particular
formatter
instance
,
set
the
``
converter
``
attribute
of
the
instance
to
a
function
with
the
same
signature
as
:
func
:`
time
.
localtime
`
or
:
func
:`
time
.
gmtime
`.
To
change
it
for
all
formatters
,
for
example
if
you
want
all
logging
times
to
be
shown
in
GMT
,
set
the
``
converter
``
attribute
in
the
Formatter
class
(
to
``
time
.
gmtime
``
for
GMT
display
).
Configuring
Logging
^^^^^^^^^^^^^^^^^^^
...
...
Lib/logging/__init__.py
View file @
40d9a4e8
...
...
@@ -433,7 +433,11 @@ class Formatter(object):
traceback.print_exception()
"""
sio
=
io
.
StringIO
()
traceback
.
print_exception
(
ei
[
0
],
ei
[
1
],
ei
[
2
],
None
,
sio
)
tb
=
ei
[
2
]
# See issues #9427, #1553375. Commented out for now.
#if getattr(self, 'fullstack', False):
# traceback.print_stack(tb.tb_frame.f_back, file=sio)
traceback
.
print_exception
(
ei
[
0
],
ei
[
1
],
tb
,
None
,
sio
)
s
=
sio
.
getvalue
()
sio
.
close
()
if
s
[
-
1
:]
==
"
\
n
"
:
...
...
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