mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Fix failing test and reorder logging to always log
This commit is contained in:
parent
4bf1e1d468
commit
3c3c52fb6a
@ -52,6 +52,7 @@ class Statsd(Logger):
|
||||
def info(self, msg, *args, **kwargs):
|
||||
"""Log a given statistic if metric, value and type are present
|
||||
"""
|
||||
Logger.info(self, msg, *args, **kwargs)
|
||||
extra = kwargs.get("extra", None)
|
||||
if extra is not None:
|
||||
metric = extra.get(METRIC_VAR, None)
|
||||
@ -66,7 +67,6 @@ class Statsd(Logger):
|
||||
self.histogram(metric, value)
|
||||
else:
|
||||
pass
|
||||
Logger.info(self, msg, *args, **kwargs)
|
||||
|
||||
# skip the run-of-the-mill logs
|
||||
def debug(self, msg, *args, **kwargs):
|
||||
|
||||
@ -48,7 +48,7 @@ def test_instrument():
|
||||
t.eq(logger.sock.msgs[0], "gunicorn.log.critical:1|c|@1.0")
|
||||
logger.sock.reset()
|
||||
|
||||
logger.access(MockResponse(200), None, {}, timedelta(seconds=7))
|
||||
logger.access(MockResponse("200 OK"), None, {}, timedelta(seconds=7))
|
||||
t.eq(logger.sock.msgs[0], "gunicorn.request.duration:7.0|ms")
|
||||
t.eq(logger.sock.msgs[1], "gunicorn.requests:1|c|@1.0")
|
||||
t.eq(logger.sock.msgs[2], "gunicorn.request.status.200:1|c|@1.0")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user