diff --git a/gunicorn/instrument/statsd.py b/gunicorn/instrument/statsd.py index fcd38311..daae4026 100644 --- a/gunicorn/instrument/statsd.py +++ b/gunicorn/instrument/statsd.py @@ -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): diff --git a/tests/test_009-statsd.py b/tests/test_009-statsd.py index 24bb6f57..aaf75dd5 100644 --- a/tests/test_009-statsd.py +++ b/tests/test_009-statsd.py @@ -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")