Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
c5b27301
Kaydet (Commit)
c5b27301
authored
Eki 31, 2010
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added style argument to logging.basicConfig() and documented this change.
üst
64474542
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
logging.rst
Doc/library/logging.rst
+10
-0
__init__.py
Lib/logging/__init__.py
+9
-1
No files found.
Doc/library/logging.rst
Dosyayı görüntüle @
c5b27301
...
...
@@ -919,6 +919,12 @@ functions.
+--------------+---------------------------------------------+
|
``
datefmt
``
|
Use
the
specified
date
/
time
format
.
|
+--------------+---------------------------------------------+
|
``
style
``
|
If
``
format
``
is
specified
,
use
this
style
|
|
|
for
the
format
string
.
One
of
'%'
,
'{'
or
|
|
|
'$'
for
%-
formatting
,
:
meth
:`
str
.
format
`
or
|
|
|
:
class
:`
string
.
Template
`
respectively
,
and
|
|
|
defaulting
to
'%'
if
not
specified
.
|
+--------------+---------------------------------------------+
|
``
level
``
|
Set
the
root
logger
level
to
the
specified
|
|
|
level
.
|
+--------------+---------------------------------------------+
...
...
@@ -928,6 +934,10 @@ functions.
|
|
present
,
'stream'
is
ignored
.
|
+--------------+---------------------------------------------+
..
versionchanged
::
3.2
The
``
style
``
argument
was
added
.
..
function
::
shutdown
()
Informs
the
logging
system
to
perform
an
orderly
shutdown
by
flushing
and
...
...
Lib/logging/__init__.py
Dosyayı görüntüle @
c5b27301
...
...
@@ -1581,6 +1581,10 @@ def basicConfig(**kwargs):
(if filemode is unspecified, it defaults to 'a').
format Use the specified format string for the handler.
datefmt Use the specified date/time format.
style If a format string is specified, use this to specify the
type of format string (possible values '
%
', '{', '$', for
%-
formatting, :meth:`str.format` and :class:`string.Template`
- defaults to '
%
').
level Set the root logger level to the specified level.
stream Use the specified stream to initialize the StreamHandler. Note
that this argument is incompatible with 'filename' - if both
...
...
@@ -1591,6 +1595,9 @@ def basicConfig(**kwargs):
remembered that StreamHandler does not close its stream (since it may be
using sys.stdout or sys.stderr), whereas FileHandler closes its stream
when the handler is closed.
.. versionchanged: 3.2
Added the ``style`` parameter.
"""
# Add thread safety in case someone mistakenly calls
# basicConfig() from multiple threads
...
...
@@ -1606,7 +1613,8 @@ def basicConfig(**kwargs):
hdlr
=
StreamHandler
(
stream
)
fs
=
kwargs
.
get
(
"format"
,
BASIC_FORMAT
)
dfs
=
kwargs
.
get
(
"datefmt"
,
None
)
fmt
=
Formatter
(
fs
,
dfs
)
style
=
kwargs
.
get
(
"style"
,
'
%
'
)
fmt
=
Formatter
(
fs
,
dfs
,
style
)
hdlr
.
setFormatter
(
fmt
)
root
.
addHandler
(
hdlr
)
level
=
kwargs
.
get
(
"level"
)
...
...
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