]> git.ipfire.org Git - thirdparty/tornado.git/commit
Send all logging to the root logger instead of per-module loggers.
authorBen Darnell <bdarnell@beaker.local>
Tue, 20 Apr 2010 22:40:33 +0000 (15:40 -0700)
committerBen Darnell <bdarnell@beaker.local>
Tue, 20 Apr 2010 22:40:33 +0000 (15:40 -0700)
commitca8002fa9f8182504e117f11c289fabe544f1a50
tree903e3737e1cd2928283372748d2e44ff547efe3d
parent40ac8d362a2f9d0f076ea1ba4d4ccec0b8ee274a
Send all logging to the root logger instead of per-module loggers.
This undoes the effect of
http://github.com/facebook/tornado/commit/e391fd289ed085671344504cc5b1fa84f5a3c774

Per-module loggers are problematic because only the top-level convenience
logging.{error,warning,...} functions configure logging on-demand, so
an app that only uses per-module loggers will produce no output except
"no handlers found for logger X".  Since tornado.ioloop swallows and logs
all exceptions, this makes it too hard to tell what's going on for apps
that do not configure logging explicitly.

Instead of setting log levels on individual module's loggers,
logging.Handler.addFilter can be used with a filter that examines
the module attribute of the log record.
12 files changed:
tornado/auth.py
tornado/autoreload.py
tornado/database.py
tornado/httpclient.py
tornado/httpserver.py
tornado/ioloop.py
tornado/iostream.py
tornado/locale.py
tornado/template.py
tornado/web.py
tornado/websocket.py
tornado/wsgi.py