From c4b506998ff4deb5c3284ab3cd875c217d3530eb Mon Sep 17 00:00:00 2001 From: Greg Price Date: Thu, 14 Sep 2017 11:52:40 -0700 Subject: [PATCH] tornado: Disable routine logging in dev. This creates a lot of logging noise, and also causes confusion for new contributors when something isn't working as they expect and they aren't sure if this message is normal or an error. --- zerver/tornado/event_queue.py | 9 +++++---- zerver/tornado/ioloop_logging.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/zerver/tornado/event_queue.py b/zerver/tornado/event_queue.py index 4f9c829140..d1b052ae46 100644 --- a/zerver/tornado/event_queue.py +++ b/zerver/tornado/event_queue.py @@ -412,10 +412,11 @@ def gc_event_queues(): # not have a current handler. do_gc_event_queues(to_remove, affected_users, affected_realms) - logging.info(('Tornado removed %d idle event queues owned by %d users in %.3fs.' + - ' Now %d active queues, %s') - % (len(to_remove), len(affected_users), time.time() - start, - len(clients), handler_stats_string())) + if settings.PRODUCTION: + logging.info(('Tornado removed %d idle event queues owned by %d users in %.3fs.' + + ' Now %d active queues, %s') + % (len(to_remove), len(affected_users), time.time() - start, + len(clients), handler_stats_string())) statsd.gauge('tornado.active_queues', len(clients)) statsd.gauge('tornado.active_users', len(user_clients)) diff --git a/zerver/tornado/ioloop_logging.py b/zerver/tornado/ioloop_logging.py index bec7b29732..c20a7b3c07 100644 --- a/zerver/tornado/ioloop_logging.py +++ b/zerver/tornado/ioloop_logging.py @@ -70,7 +70,7 @@ class InstrumentedPoll(object): in_poll = sum(b-a for a, b in self._times) if total > 0: percent_busy = 100 * (1 - in_poll / total) - if settings.PRODUCTION or percent_busy > 20: + if settings.PRODUCTION: logging.info('Tornado %5.1f%% busy over the past %4.1f seconds' % (percent_busy, total)) self._last_print = t1