From 0b5c4aea99f56427116d1092e92b6ee0098dd507 Mon Sep 17 00:00:00 2001 From: Florian Demmer Date: Fri, 20 May 2022 11:37:53 +0200 Subject: [PATCH] Fix LogRecord pre-formatting, closes #2801 --- docs/source/settings.rst | 2 +- gunicorn/config.py | 2 +- gunicorn/workers/ggevent.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/settings.rst b/docs/source/settings.rst index a322b615..9fef88ec 100644 --- a/docs/source/settings.rst +++ b/docs/source/settings.rst @@ -836,7 +836,7 @@ The callable needs to accept a single instance variable for the Arbiter. .. code-block:: python def pre_request(worker, req): - worker.log.debug("%s %s" % (req.method, req.path)) + worker.log.debug("%s %s", req.method, req.path) Called just before a worker processes the request. diff --git a/gunicorn/config.py b/gunicorn/config.py index a41bd21c..64a12506 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -1906,7 +1906,7 @@ class PreRequest(Setting): type = callable def pre_request(worker, req): - worker.log.debug("%s %s" % (req.method, req.path)) + worker.log.debug("%s %s", req.method, req.path) default = staticmethod(pre_request) desc = """\ Called just before a worker processes the request. diff --git a/gunicorn/workers/ggevent.py b/gunicorn/workers/ggevent.py index 0a844db3..5c41f14e 100644 --- a/gunicorn/workers/ggevent.py +++ b/gunicorn/workers/ggevent.py @@ -110,7 +110,7 @@ class GeventWorker(AsyncWorker): gevent.sleep(1.0) # Force kill all active the handlers - self.log.warning("Worker graceful timeout (pid:%s)" % self.pid) + self.log.warning("Worker graceful timeout (pid:%s)", self.pid) for server in servers: server.stop(timeout=1) except Exception: