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
9bec7fa7
Kaydet (Commit)
9bec7fa7
authored
Eyl 16, 2005
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Misc. backported changes
üst
39871c89
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
__init__.py
Lib/logging/__init__.py
+12
-3
config.py
Lib/logging/config.py
+3
-3
No files found.
Lib/logging/__init__.py
Dosyayı görüntüle @
9bec7fa7
...
@@ -52,7 +52,9 @@ __date__ = "27 March 2005"
...
@@ -52,7 +52,9 @@ __date__ = "27 March 2005"
# _srcfile is used when walking the stack to check when we've got the first
# _srcfile is used when walking the stack to check when we've got the first
# caller stack frame.
# caller stack frame.
#
#
if
string
.
lower
(
__file__
[
-
4
:])
in
[
'.pyc'
,
'.pyo'
]:
if
hasattr
(
sys
,
'frozen'
):
#support for py2exe
_srcfile
=
"logging
%
s__init__
%
s"
%
(
os
.
sep
,
__file__
[
-
4
:])
elif
string
.
lower
(
__file__
[
-
4
:])
in
[
'.pyc'
,
'.pyo'
]:
_srcfile
=
__file__
[:
-
4
]
+
'.py'
_srcfile
=
__file__
[:
-
4
]
+
'.py'
else
:
else
:
_srcfile
=
__file__
_srcfile
=
__file__
...
@@ -542,6 +544,7 @@ class Filterer:
...
@@ -542,6 +544,7 @@ class Filterer:
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
_handlers
=
{}
#repository of handlers (for flushing when shutdown called)
_handlers
=
{}
#repository of handlers (for flushing when shutdown called)
_handlerList
=
[]
# added to allow handlers to be removed in reverse of order initialized
class
Handler
(
Filterer
):
class
Handler
(
Filterer
):
"""
"""
...
@@ -564,6 +567,7 @@ class Handler(Filterer):
...
@@ -564,6 +567,7 @@ class Handler(Filterer):
_acquireLock
()
_acquireLock
()
try
:
#unlikely to raise an exception, but you never know...
try
:
#unlikely to raise an exception, but you never know...
_handlers
[
self
]
=
1
_handlers
[
self
]
=
1
_handlerList
.
insert
(
0
,
self
)
finally
:
finally
:
_releaseLock
()
_releaseLock
()
self
.
createLock
()
self
.
createLock
()
...
@@ -666,6 +670,7 @@ class Handler(Filterer):
...
@@ -666,6 +670,7 @@ class Handler(Filterer):
_acquireLock
()
_acquireLock
()
try
:
#unlikely to raise an exception, but you never know...
try
:
#unlikely to raise an exception, but you never know...
del
_handlers
[
self
]
del
_handlers
[
self
]
_handlerList
.
remove
(
self
)
finally
:
finally
:
_releaseLock
()
_releaseLock
()
...
@@ -1085,7 +1090,11 @@ class Logger(Filterer):
...
@@ -1085,7 +1090,11 @@ class Logger(Filterer):
"""
"""
if
hdlr
in
self
.
handlers
:
if
hdlr
in
self
.
handlers
:
#hdlr.close()
#hdlr.close()
self
.
handlers
.
remove
(
hdlr
)
hdlr
.
acquire
()
try
:
self
.
handlers
.
remove
(
hdlr
)
finally
:
hdlr
.
release
()
def
callHandlers
(
self
,
record
):
def
callHandlers
(
self
,
record
):
"""
"""
...
@@ -1305,7 +1314,7 @@ def shutdown():
...
@@ -1305,7 +1314,7 @@ def shutdown():
Should be called at application exit.
Should be called at application exit.
"""
"""
for
h
in
_handlers
.
keys
():
for
h
in
_handler
List
[:]:
# was _handler
s.keys():
#errors might occur, for example, if files are locked
#errors might occur, for example, if files are locked
#we just ignore them
#we just ignore them
try
:
try
:
...
...
Lib/logging/config.py
Dosyayı görüntüle @
9bec7fa7
...
@@ -225,9 +225,9 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
...
@@ -225,9 +225,9 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
"""
"""
Handle a request.
Handle a request.
Each request is expected to be a 4-byte length,
Each request is expected to be a 4-byte length,
packed using
followed by the config file. Uses fileConfig() to do the
struct.pack(">L", n), followed by the config file.
grunt work.
Uses fileConfig() to do the
grunt work.
"""
"""
import
tempfile
import
tempfile
try
:
try
:
...
...
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