Skip to content

Instantly share code, notes, and snippets.

@shazow
Created July 11, 2010 05:00
Show Gist options
  • Save shazow/471291 to your computer and use it in GitHub Desktop.
Save shazow/471291 to your computer and use it in GitHub Desktop.
Hack for logging a deprecation warning when a deprecated route is visited.
# ...
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