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
68b4cc87
Kaydet (Commit)
68b4cc87
authored
Mar 23, 2013
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #17521: Corrected non-enabling of logger following two calls to fileConfig().
üst
a4cfd60f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
4 deletions
+37
-4
config.py
Lib/logging/config.py
+2
-2
test_logging.py
Lib/test/test_logging.py
+32
-2
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/logging/config.py
Dosyayı görüntüle @
68b4cc87
...
...
@@ -175,8 +175,8 @@ def _handle_existing_loggers(existing, child_loggers, disable_existing):
logger
.
level
=
logging
.
NOTSET
logger
.
handlers
=
[]
logger
.
propagate
=
True
el
if
disable_existing
:
logger
.
disabled
=
True
el
se
:
logger
.
disabled
=
disable_existing
def
_install_loggers
(
cp
,
handlers
,
disable_existing
):
"""Create and install loggers"""
...
...
Lib/test/test_logging.py
Dosyayı görüntüle @
68b4cc87
...
...
@@ -764,9 +764,30 @@ class ConfigFileTest(BaseTest):
datefmt=
"""
def
apply_config
(
self
,
conf
):
disable_test
=
"""
[loggers]
keys=root
[handlers]
keys=screen
[formatters]
keys=
[logger_root]
level=DEBUG
handlers=screen
[handler_screen]
level=DEBUG
class=StreamHandler
args=(sys.stdout,)
formatter=
"""
def
apply_config
(
self
,
conf
,
**
kwargs
):
file
=
io
.
StringIO
(
textwrap
.
dedent
(
conf
))
logging
.
config
.
fileConfig
(
file
)
logging
.
config
.
fileConfig
(
file
,
**
kwargs
)
def
test_config0_ok
(
self
):
# A simple config file which overrides the default settings.
...
...
@@ -870,6 +891,15 @@ class ConfigFileTest(BaseTest):
# Original logger output is empty.
self
.
assert_log_lines
([])
def
test_logger_disabling
(
self
):
self
.
apply_config
(
self
.
disable_test
)
logger
=
logging
.
getLogger
(
'foo'
)
self
.
assertFalse
(
logger
.
disabled
)
self
.
apply_config
(
self
.
disable_test
)
self
.
assertTrue
(
logger
.
disabled
)
self
.
apply_config
(
self
.
disable_test
,
disable_existing_loggers
=
False
)
self
.
assertFalse
(
logger
.
disabled
)
class
LogRecordStreamHandler
(
StreamRequestHandler
):
"""Handler for a streaming logging request. It saves the log message in the
...
...
Misc/NEWS
Dosyayı görüntüle @
68b4cc87
...
...
@@ -233,6 +233,9 @@ Core and Builtins
Library
-------
- Issue #17521: Corrected non-enabling of logger following two calls to
fileConfig().
- Issue #17508: Corrected MemoryHandler configuration in dictConfig() where
the target handler wasn't configured first.
...
...
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