Иван Солнцев
a4f7411e10
- Move log initialization to config file; - Add meta tag for charset to index file.
22 lines
808 B
Python
22 lines
808 B
Python
import logging
|
|
|
|
|
|
log = logging.getLogger(__name__)
|
|
|
|
|
|
def path(path="/", _type="static-file", link="index.html", methods=("GET",)):
|
|
log.debug("Start generate path for %s address" % path)
|
|
|
|
if _type == "static-file":
|
|
log.info("Path %s is %s and linked %s for methods %s" % (path, _type, link, methods))
|
|
return {path: (methods, _type, "static/{}".format(link))}
|
|
|
|
elif _type == "redirect":
|
|
log.info("Path %s is %s and linked %s for methods %s" % (path, _type, link, methods))
|
|
return {path: (methods, _type, link)}
|
|
|
|
elif _type == "function":
|
|
log.info("Path %s is %s and linked %s for methods %s" % (path, _type, link, methods))
|
|
return {path: (methods, _type, link)}
|
|
else:
|
|
log.error("Path %s is %s but it type is unknown" % (path, _type))
|