cn-py-serv/config.py
Иван Солнцев a4f7411e10 Add more debug messages
- Move log initialization to config file;
- Add meta tag for charset to index file.
2024-07-03 14:06:19 +03:00

27 lines
734 B
Python

import logging
from server.urlhandler import path
import testmod
SETUP = {
"setup": {
"log_to_file": False,
"log_level": logging.DEBUG
},
"server": {
"port": 8080,
}
}
if SETUP["setup"]["log_to_file"]:
logging.basicConfig(filename="main.log", filemode="a", encoding="UTF-8",
level=SETUP["setup"]["log_level"],
format="[%(name)s][%(asctime)s][%(levelname)s] %(message)s")
else:
logging.basicConfig(encoding="UTF-8", level=SETUP["setup"]["log_level"],
format="[%(name)s][%(asctime)s][%(levelname)s] %(message)s")
urls = [
path("/", "static-file", "index.html"),
path("/func", "function", testmod.work)
]