Created
July 11, 2010 05:00
-
-
Save shazow/471291 to your computer and use it in GitHub Desktop.
Hack for logging a deprecation warning when a deprecated route is visited.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ... | |
import logging | |
log = logging.getLogger(__name__) | |
def warn_deprecated(environ, result): | |
log.warn("Deprecated route used: %s" % environ['PATH_INFO']) | |
return True | |
def make_map(config): | |
# ... | |
map.connect('/my-deprecated-route/foo', controller='foo', action='bar', | |
conditions=dict(function=warn_deprecated)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment