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
d489ac91
Kaydet (Commit)
d489ac91
authored
Ara 31, 2016
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Closes #28524: added default level for logging.disable().
üst
8e9c42e8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
logging.rst
Doc/library/logging.rst
+9
-1
__init__.py
Lib/logging/__init__.py
+1
-1
test_logging.py
Lib/test/test_logging.py
+5
-0
No files found.
Doc/library/logging.rst
Dosyayı görüntüle @
d489ac91
...
...
@@ -1023,7 +1023,7 @@ functions.
handlers
being
added
multiple
times
to
the
root
logger
,
which
can
in
turn
lead
to
multiple
messages
for
the
same
event
.
..
function
::
disable
(
lvl
)
..
function
::
disable
(
lvl
=
CRITICAL
)
Provides
an
overriding
level
*
lvl
*
for
all
loggers
which
takes
precedence
over
the
logger
's own level. When the need arises to temporarily throttle logging
...
...
@@ -1036,6 +1036,14 @@ functions.
overriding
level
,
so
that
logging
output
again
depends
on
the
effective
levels
of
individual
loggers
.
Note
that
if
you
have
defined
any
custom
logging
level
higher
than
``
CRITICAL
``
(
this
is
not
recommended
),
you
won
't be able to rely on the
default value for the *lvl* parameter, but will have to explicitly supply a
suitable value.
.. versionchanged:: 3.7
The *lvl* parameter was defaulted to level ``CRITICAL``. See Issue
#28524 for more information about this change.
.. function:: addLevelName(lvl, levelName)
...
...
Lib/logging/__init__.py
Dosyayı görüntüle @
d489ac91
...
...
@@ -1889,7 +1889,7 @@ def log(level, msg, *args, **kwargs):
basicConfig
()
root
.
log
(
level
,
msg
,
*
args
,
**
kwargs
)
def
disable
(
level
):
def
disable
(
level
=
CRITICAL
):
"""
Disable all logging calls of severity 'level' and below.
"""
...
...
Lib/test/test_logging.py
Dosyayı görüntüle @
d489ac91
...
...
@@ -3473,6 +3473,11 @@ class ModuleLevelMiscTest(BaseTest):
logging
.
disable
(
83
)
self
.
assertEqual
(
logging
.
root
.
manager
.
disable
,
83
)
# test the default value introduced in 3.7
# (Issue #28524)
logging
.
disable
()
self
.
assertEqual
(
logging
.
root
.
manager
.
disable
,
logging
.
CRITICAL
)
def
_test_log
(
self
,
method
,
level
=
None
):
called
=
[]
support
.
patch
(
self
,
logging
,
'basicConfig'
,
...
...
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