def METHOD_NAME(lvl):
  """Decorator to set the access log level of a view function."""
  if lvl not in (logging.DEBUG, logging.WARN, logging.ERROR, logging.CRITICAL, logging.FATAL):
    raise ValueError('%s is not a valid logging level' % (lvl,))
  def deco_view(func):
    func.METHOD_NAME = lvl
    return func
  return deco_view