Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

configurable getLogger callable #10

Merged
merged 3 commits into from

2 participants

@rafrombrc
Collaborator

This small change allows the getLogger callable to be specified in the Pyramid settings so that downstream code can use logging mechanisms other than stdlib's logging.

@blaflamme blaflamme merged commit 43fb940 into Pylons:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 3 deletions.
  1. +2 −1  CONTRIBUTORS.txt
  2. +3 −2 pyramid_exclog/__init__.py
View
3  CONTRIBUTORS.txt
@@ -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
View
5 pyramid_exclog/__init__.py
@@ -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)
Something went wrong with that request. Please try again.