mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Don't stringify T and D logging atoms (Fixes #621)
This commit is contained in:
parent
f47262c5ae
commit
cc193ff266
@ -86,7 +86,10 @@ class SafeAtoms(dict):
|
|||||||
def __init__(self, atoms):
|
def __init__(self, atoms):
|
||||||
dict.__init__(self)
|
dict.__init__(self)
|
||||||
for key, value in atoms.items():
|
for key, value in atoms.items():
|
||||||
self[key] = value.replace('"', '\\"')
|
if isinstance(value, basestring):
|
||||||
|
self[key] = value.replace('"', '\\"')
|
||||||
|
else:
|
||||||
|
self[key] = value
|
||||||
|
|
||||||
def __getitem__(self, k):
|
def __getitem__(self, k):
|
||||||
if k.startswith("{"):
|
if k.startswith("{"):
|
||||||
@ -238,8 +241,8 @@ class Logger(object):
|
|||||||
'b': resp.response_length and str(resp.response_length) or '-',
|
'b': resp.response_length and str(resp.response_length) or '-',
|
||||||
'f': environ.get('HTTP_REFERER', '-'),
|
'f': environ.get('HTTP_REFERER', '-'),
|
||||||
'a': environ.get('HTTP_USER_AGENT', '-'),
|
'a': environ.get('HTTP_USER_AGENT', '-'),
|
||||||
'T': str(request_time.seconds),
|
'T': request_time.seconds,
|
||||||
'D': str(request_time.microseconds),
|
'D': request_time.microseconds,
|
||||||
'p': "<%s>" % os.getpid()
|
'p': "<%s>" % os.getpid()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user