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
f0509037
Kaydet (Commit)
f0509037
authored
Şub 23, 2012
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix added for recent changes in non-threading environments.
üst
0abf61db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
7 deletions
+28
-7
__init__.py
Lib/logging/__init__.py
+8
-2
handlers.py
Lib/logging/handlers.py
+20
-5
No files found.
Lib/logging/__init__.py
Dosyayı görüntüle @
f0509037
...
@@ -917,9 +917,12 @@ class StreamHandler(Handler):
...
@@ -917,9 +917,12 @@ class StreamHandler(Handler):
"""
"""
Flushes the stream.
Flushes the stream.
"""
"""
with
self
.
lock
:
self
.
acquire
()
try
:
if
self
.
stream
and
hasattr
(
self
.
stream
,
"flush"
):
if
self
.
stream
and
hasattr
(
self
.
stream
,
"flush"
):
self
.
stream
.
flush
()
self
.
stream
.
flush
()
finally
:
self
.
release
()
def
emit
(
self
,
record
):
def
emit
(
self
,
record
):
"""
"""
...
@@ -970,13 +973,16 @@ class FileHandler(StreamHandler):
...
@@ -970,13 +973,16 @@ class FileHandler(StreamHandler):
"""
"""
Closes the stream.
Closes the stream.
"""
"""
with
self
.
lock
:
self
.
acquire
()
try
:
if
self
.
stream
:
if
self
.
stream
:
self
.
flush
()
self
.
flush
()
if
hasattr
(
self
.
stream
,
"close"
):
if
hasattr
(
self
.
stream
,
"close"
):
self
.
stream
.
close
()
self
.
stream
.
close
()
StreamHandler
.
close
(
self
)
StreamHandler
.
close
(
self
)
self
.
stream
=
None
self
.
stream
=
None
finally
:
self
.
release
()
def
_open
(
self
):
def
_open
(
self
):
"""
"""
...
...
Lib/logging/handlers.py
Dosyayı görüntüle @
f0509037
...
@@ -553,11 +553,14 @@ class SocketHandler(logging.Handler):
...
@@ -553,11 +553,14 @@ class SocketHandler(logging.Handler):
"""
"""
Closes the socket.
Closes the socket.
"""
"""
with
self
.
lock
:
self
.
acquire
()
try
:
if
self
.
sock
:
if
self
.
sock
:
self
.
sock
.
close
()
self
.
sock
.
close
()
self
.
sock
=
None
self
.
sock
=
None
logging
.
Handler
.
close
(
self
)
logging
.
Handler
.
close
(
self
)
finally
:
self
.
release
()
class
DatagramHandler
(
SocketHandler
):
class
DatagramHandler
(
SocketHandler
):
"""
"""
...
@@ -752,10 +755,13 @@ class SysLogHandler(logging.Handler):
...
@@ -752,10 +755,13 @@ class SysLogHandler(logging.Handler):
"""
"""
Closes the socket.
Closes the socket.
"""
"""
with
self
.
lock
:
self
.
acquire
()
try
:
if
self
.
unixsocket
:
if
self
.
unixsocket
:
self
.
socket
.
close
()
self
.
socket
.
close
()
logging
.
Handler
.
close
(
self
)
logging
.
Handler
.
close
(
self
)
finally
:
self
.
release
()
def
mapPriority
(
self
,
levelName
):
def
mapPriority
(
self
,
levelName
):
"""
"""
...
@@ -1096,8 +1102,11 @@ class BufferingHandler(logging.Handler):
...
@@ -1096,8 +1102,11 @@ class BufferingHandler(logging.Handler):
This version just zaps the buffer to empty.
This version just zaps the buffer to empty.
"""
"""
with
self
.
lock
:
self
.
acquire
()
try
:
self
.
buffer
=
[]
self
.
buffer
=
[]
finally
:
self
.
release
()
def
close
(
self
):
def
close
(
self
):
"""
"""
...
@@ -1147,20 +1156,26 @@ class MemoryHandler(BufferingHandler):
...
@@ -1147,20 +1156,26 @@ class MemoryHandler(BufferingHandler):
The record buffer is also cleared by this operation.
The record buffer is also cleared by this operation.
"""
"""
with
self
.
lock
:
self
.
acquire
()
try
:
if
self
.
target
:
if
self
.
target
:
for
record
in
self
.
buffer
:
for
record
in
self
.
buffer
:
self
.
target
.
handle
(
record
)
self
.
target
.
handle
(
record
)
self
.
buffer
=
[]
self
.
buffer
=
[]
finally
:
self
.
release
()
def
close
(
self
):
def
close
(
self
):
"""
"""
Flush, set the target to None and lose the buffer.
Flush, set the target to None and lose the buffer.
"""
"""
self
.
flush
()
self
.
flush
()
with
self
.
lock
:
self
.
acquire
()
try
:
self
.
target
=
None
self
.
target
=
None
BufferingHandler
.
close
(
self
)
BufferingHandler
.
close
(
self
)
finally
:
self
.
release
()
class
QueueHandler
(
logging
.
Handler
):
class
QueueHandler
(
logging
.
Handler
):
...
...
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