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
57c22379
Kaydet (Commit)
57c22379
authored
Şub 23, 2012
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merged logging flush/close changes from 3.2.
üst
c4c90bdf
0abf61db
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
__init__.py
Lib/logging/__init__.py
+4
-2
handlers.py
Lib/logging/handlers.py
+8
-4
No files found.
Lib/logging/__init__.py
Dosyayı görüntüle @
57c22379
...
@@ -16,9 +16,9 @@
...
@@ -16,9 +16,9 @@
"""
"""
Logging package for Python. Based on PEP 282 and comments thereto in
Logging package for Python. Based on PEP 282 and comments thereto in
comp.lang.python
, and influenced by Apache's log4j system
.
comp.lang.python.
Copyright (C) 2001-201
1
Vinay Sajip. All Rights Reserved.
Copyright (C) 2001-201
2
Vinay Sajip. All Rights Reserved.
To use, simply 'import logging' and log away!
To use, simply 'import logging' and log away!
"""
"""
...
@@ -914,6 +914,7 @@ class StreamHandler(Handler):
...
@@ -914,6 +914,7 @@ class StreamHandler(Handler):
"""
"""
Flushes the stream.
Flushes the stream.
"""
"""
with
self
.
lock
:
if
self
.
stream
and
hasattr
(
self
.
stream
,
"flush"
):
if
self
.
stream
and
hasattr
(
self
.
stream
,
"flush"
):
self
.
stream
.
flush
()
self
.
stream
.
flush
()
...
@@ -964,6 +965,7 @@ class FileHandler(StreamHandler):
...
@@ -964,6 +965,7 @@ class FileHandler(StreamHandler):
"""
"""
Closes the stream.
Closes the stream.
"""
"""
with
self
.
lock
:
if
self
.
stream
:
if
self
.
stream
:
self
.
flush
()
self
.
flush
()
if
hasattr
(
self
.
stream
,
"close"
):
if
hasattr
(
self
.
stream
,
"close"
):
...
...
Lib/logging/handlers.py
Dosyayı görüntüle @
57c22379
# Copyright 2001-201
0
by Vinay Sajip. All Rights Reserved.
# Copyright 2001-201
2
by Vinay Sajip. All Rights Reserved.
#
#
# Permission to use, copy, modify, and distribute this software and its
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# documentation for any purpose and without fee is hereby granted,
...
@@ -16,10 +16,9 @@
...
@@ -16,10 +16,9 @@
"""
"""
Additional handlers for the logging package for Python. The core package is
Additional handlers for the logging package for Python. The core package is
based on PEP 282 and comments thereto in comp.lang.python, and influenced by
based on PEP 282 and comments thereto in comp.lang.python.
Apache's log4j system.
Copyright (C) 2001-201
0
Vinay Sajip. All Rights Reserved.
Copyright (C) 2001-201
2
Vinay Sajip. All Rights Reserved.
To use, simply 'import logging.handlers' and log away!
To use, simply 'import logging.handlers' and log away!
"""
"""
...
@@ -594,6 +593,7 @@ class SocketHandler(logging.Handler):
...
@@ -594,6 +593,7 @@ class SocketHandler(logging.Handler):
"""
"""
Closes the socket.
Closes the socket.
"""
"""
with
self
.
lock
:
if
self
.
sock
:
if
self
.
sock
:
self
.
sock
.
close
()
self
.
sock
.
close
()
self
.
sock
=
None
self
.
sock
=
None
...
@@ -792,6 +792,7 @@ class SysLogHandler(logging.Handler):
...
@@ -792,6 +792,7 @@ class SysLogHandler(logging.Handler):
"""
"""
Closes the socket.
Closes the socket.
"""
"""
with
self
.
lock
:
self
.
socket
.
close
()
self
.
socket
.
close
()
logging
.
Handler
.
close
(
self
)
logging
.
Handler
.
close
(
self
)
...
@@ -1137,6 +1138,7 @@ class BufferingHandler(logging.Handler):
...
@@ -1137,6 +1138,7 @@ class BufferingHandler(logging.Handler):
This version just zaps the buffer to empty.
This version just zaps the buffer to empty.
"""
"""
with
self
.
lock
:
self
.
buffer
=
[]
self
.
buffer
=
[]
def
close
(
self
):
def
close
(
self
):
...
@@ -1187,6 +1189,7 @@ class MemoryHandler(BufferingHandler):
...
@@ -1187,6 +1189,7 @@ class MemoryHandler(BufferingHandler):
The record buffer is also cleared by this operation.
The record buffer is also cleared by this operation.
"""
"""
with
self
.
lock
:
if
self
.
target
:
if
self
.
target
:
for
record
in
self
.
buffer
:
for
record
in
self
.
buffer
:
self
.
target
.
handle
(
record
)
self
.
target
.
handle
(
record
)
...
@@ -1197,6 +1200,7 @@ class MemoryHandler(BufferingHandler):
...
@@ -1197,6 +1200,7 @@ class MemoryHandler(BufferingHandler):
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
.
target
=
None
self
.
target
=
None
BufferingHandler
.
close
(
self
)
BufferingHandler
.
close
(
self
)
...
...
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