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
ed1992f2
Kaydet (Commit)
ed1992f2
authored
Şub 09, 2006
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added function name to LogRecord.
üst
260ce432
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
__init__.py
Lib/logging/__init__.py
+8
-5
No files found.
Lib/logging/__init__.py
Dosyayı görüntüle @
ed1992f2
...
...
@@ -203,7 +203,8 @@ class LogRecord:
the source line where the logging call was made, and any exception
information to be logged.
"""
def
__init__
(
self
,
name
,
level
,
pathname
,
lineno
,
msg
,
args
,
exc_info
):
def
__init__
(
self
,
name
,
level
,
pathname
,
lineno
,
msg
,
args
,
exc_info
,
func
):
"""
Initialize a logging record with interesting information.
"""
...
...
@@ -238,6 +239,7 @@ class LogRecord:
self
.
exc_info
=
exc_info
self
.
exc_text
=
None
# used to cache the traceback text
self
.
lineno
=
lineno
self
.
funcName
=
func
self
.
created
=
ct
self
.
msecs
=
(
ct
-
long
(
ct
))
*
1000
self
.
relativeCreated
=
(
self
.
created
-
_startTime
)
*
1000
...
...
@@ -283,7 +285,7 @@ def makeLogRecord(dict):
a socket connection (which is sent as a dictionary) into a LogRecord
instance.
"""
rv
=
LogRecord
(
None
,
None
,
""
,
0
,
""
,
(),
None
)
rv
=
LogRecord
(
None
,
None
,
""
,
0
,
""
,
(),
None
,
None
)
rv
.
__dict__
.
update
(
dict
)
return
rv
...
...
@@ -318,6 +320,7 @@ class Formatter:
%(module)
s Module (name portion of filename)
%(lineno)
d Source line number where the logging call was issued
(if available)
%(funcName)
s Function name
%(created)
f Time when the LogRecord was created (time.time()
return value)
%(asctime)
s Textual time when the LogRecord was created
...
...
@@ -1053,12 +1056,12 @@ class Logger(Filterer):
continue
return
filename
,
f
.
f_lineno
,
co
.
co_name
def
makeRecord
(
self
,
name
,
level
,
fn
,
lno
,
msg
,
args
,
exc_info
,
extra
=
None
):
def
makeRecord
(
self
,
name
,
level
,
fn
,
lno
,
msg
,
args
,
exc_info
,
func
=
None
,
extra
=
None
):
"""
A factory method which can be overridden in subclasses to create
specialized LogRecords.
"""
rv
=
LogRecord
(
name
,
level
,
fn
,
lno
,
msg
,
args
,
exc_info
)
rv
=
LogRecord
(
name
,
level
,
fn
,
lno
,
msg
,
args
,
exc_info
,
func
)
if
extra
:
for
key
in
extra
:
if
(
key
in
[
"message"
,
"asctime"
])
or
(
key
in
rv
.
__dict__
):
...
...
@@ -1078,7 +1081,7 @@ class Logger(Filterer):
if
exc_info
:
if
type
(
exc_info
)
!=
types
.
TupleType
:
exc_info
=
sys
.
exc_info
()
record
=
self
.
makeRecord
(
self
.
name
,
level
,
fn
,
lno
,
msg
,
args
,
exc_info
,
extra
)
record
=
self
.
makeRecord
(
self
.
name
,
level
,
fn
,
lno
,
msg
,
args
,
exc_info
,
func
,
extra
)
self
.
handle
(
record
)
def
handle
(
self
,
record
):
...
...
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