From 64f98a0a1c3c9a530606229b703458071390dc41 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 14 Feb 2014 15:15:35 -0800 Subject: [PATCH] arbiter: Consolidate configuration logging Benoit prefers the log prefix for the first line ("Current configuration:") but not subsequent lines (" {config}: {value}") [1], so consolidate to a single log.debug call. The newer '{0}'.format() syntax requires Python 2.6 [2], but our setup.py only claims compatibility with 2.6, 2.7, 3.2, and 3.3, so that should be fine. [1]: https://github.com/benoitc/gunicorn/pull/701/files#r9767234 [2]: http://docs.python.org/2/whatsnew/2.6.html#pep-3101-advanced-string-formatting --- THANKS | 1 + gunicorn/arbiter.py | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/THANKS b/THANKS index 1570cf2f..1f543194 100644 --- a/THANKS +++ b/THANKS @@ -72,3 +72,4 @@ Xie Shi Steven Cummings Malthe Borch Berker Peksag +W. Trevor King diff --git a/gunicorn/arbiter.py b/gunicorn/arbiter.py index 68385a94..41c687a0 100644 --- a/gunicorn/arbiter.py +++ b/gunicorn/arbiter.py @@ -99,10 +99,12 @@ class Arbiter(object): self.timeout = self.cfg.timeout self.proc_name = self.cfg.proc_name - self.log.debug("Current configuration:") - for config, value in sorted(self.cfg.settings.items(), - key=lambda setting: setting[1]): - self.log.debug(" %s: %s", config, value.value) + self.log.debug('Current configuration:\n{0}'.format( + '\n'.join( + ' {0}: {1}'.format(config, value.value) + for config, value + in sorted(self.cfg.settings.items(), + key=lambda setting: setting[1])))) if self.cfg.preload_app: self.app.wsgi()