logging: Drop confusing use of `propagate` in test_settings.

This line was added in e8ab7cd1a as a desperate measure to get the
`set_loglevel` helper to successfully suppress the `zulip.send_email`
logs.

In fact, the reason that just setting `level` there wasn't doing the
job had nothing to do with `propagate`, which doesn't interact with
`level`.  (See the long block comment in `zproject/settings.py`,
searching for "Python logging module", for my attempt at concisely
explaining these semantics.)  Rather, our setting for `level` was
getting clobbered by the use of `create_logger`; and setting
`propagate` to False worked by completely suppressing all logs to
`zulip.send_email` and descendants from reaching the normal handlers,
regardless of the log messages' levels.

Now that the `create_logger` issue is fixed (see a few commits before
this one), drop that.
This commit is contained in:
Greg Price 2017-12-12 17:03:47 -08:00
parent b830b446f1
commit cd5e44491c
1 changed files with 0 additions and 1 deletions

View File

@ -117,7 +117,6 @@ if not CASPER_TESTS:
def set_loglevel(logger_name, level) -> None: def set_loglevel(logger_name, level) -> None:
LOGGING['loggers'].setdefault(logger_name, {})['level'] = level LOGGING['loggers'].setdefault(logger_name, {})['level'] = level
LOGGING['loggers'].setdefault(logger_name, {})['propagate'] = False
set_loglevel('zulip.requests', 'CRITICAL') set_loglevel('zulip.requests', 'CRITICAL')
set_loglevel('zulip.management', 'CRITICAL') set_loglevel('zulip.management', 'CRITICAL')
set_loglevel('django.request', 'ERROR') set_loglevel('django.request', 'ERROR')