Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

configurable getLogger callable #10

Merged
merged 3 commits into from Apr 24, 2012
Jump to file or symbol
Failed to load files and symbols.
+5 −3
Split
View
@@ -98,4 +98,5 @@ Contributors
------------
- Chris McDonough, 2011/08/11
-- Jason McKellar, 2012/01/09
+- Jason McKellar, 2012/01/09
+- Rob Miller, 2012/04/24
@@ -1,4 +1,3 @@
-import logging
import sys
from pprint import pformat
from textwrap import dedent
@@ -37,8 +36,10 @@ def exclog_tween_factory(handler, registry):
ignored = get('exclog.ignore', (WSGIHTTPException,))
extra_info = get('exclog.extra_info', False)
+ getLogger = get('exclog.getLogger', 'logging.getLogger')
+ getLogger = resolver.resolve(getLogger)
- def exclog_tween(request, getLogger=logging.getLogger):
+ def exclog_tween(request, getLogger=getLogger):
# getLogger injected for testing purposes
try:
return handler(request)