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
97ef165a
Kaydet (Commit)
97ef165a
authored
Ock 24, 2008
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added optional delay argument to FileHandler and subclasses.
üst
7b7ce785
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
+20
-5
__init__.py
Lib/logging/__init__.py
+20
-5
No files found.
Lib/logging/__init__.py
Dosyayı görüntüle @
97ef165a
...
@@ -41,8 +41,8 @@ except ImportError:
...
@@ -41,8 +41,8 @@ except ImportError:
__author__
=
"Vinay Sajip <vinay_sajip@red-dove.com>"
__author__
=
"Vinay Sajip <vinay_sajip@red-dove.com>"
__status__
=
"production"
__status__
=
"production"
__version__
=
"0.5.0.
4
"
__version__
=
"0.5.0.
5
"
__date__
=
"
18
January 2008"
__date__
=
"
24
January 2008"
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
# Miscellaneous module data
# Miscellaneous module data
...
@@ -763,7 +763,7 @@ class FileHandler(StreamHandler):
...
@@ -763,7 +763,7 @@ class FileHandler(StreamHandler):
"""
"""
A handler class which writes formatted logging records to disk files.
A handler class which writes formatted logging records to disk files.
"""
"""
def
__init__
(
self
,
filename
,
mode
=
'a'
,
encoding
=
None
):
def
__init__
(
self
,
filename
,
mode
=
'a'
,
encoding
=
None
,
delay
=
0
):
"""
"""
Open the specified file and use it as the stream for logging.
Open the specified file and use it as the stream for logging.
"""
"""
...
@@ -774,8 +774,11 @@ class FileHandler(StreamHandler):
...
@@ -774,8 +774,11 @@ class FileHandler(StreamHandler):
self
.
baseFilename
=
os
.
path
.
abspath
(
filename
)
self
.
baseFilename
=
os
.
path
.
abspath
(
filename
)
self
.
mode
=
mode
self
.
mode
=
mode
self
.
encoding
=
encoding
self
.
encoding
=
encoding
stream
=
self
.
_open
()
if
delay
:
StreamHandler
.
__init__
(
self
,
stream
)
self
.
stream
=
None
else
:
stream
=
self
.
_open
()
StreamHandler
.
__init__
(
self
,
stream
)
def
close
(
self
):
def
close
(
self
):
"""
"""
...
@@ -798,6 +801,18 @@ class FileHandler(StreamHandler):
...
@@ -798,6 +801,18 @@ class FileHandler(StreamHandler):
stream
=
codecs
.
open
(
self
.
baseFilename
,
self
.
mode
,
self
.
encoding
)
stream
=
codecs
.
open
(
self
.
baseFilename
,
self
.
mode
,
self
.
encoding
)
return
stream
return
stream
def
emit
(
self
,
record
):
"""
Emit a record.
If the stream was not opened because 'delay' was specified in the
constructor, open it before calling the superclass's emit.
"""
if
self
.
stream
is
None
:
stream
=
self
.
_open
()
StreamHandler
.
__init__
(
self
,
stream
)
StreamHandler
.
emit
(
self
,
record
)
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
# Manager classes and functions
# Manager classes and functions
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
...
...
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