18 lines
487 B
Python
18 lines
487 B
Python
import logging
|
|
from pathlib import Path
|
|
|
|
Path("data/logs").mkdir(parents=True, exist_ok=True)
|
|
Path("data/logs/app.log").open("a")
|
|
logging.basicConfig(
|
|
level=logging.ERROR,
|
|
filename="data/logs/app.log",
|
|
filemode="a",
|
|
format="%(asctime)s - %(levelname)s - %(name)s - %(message)s",
|
|
)
|
|
|
|
logging.debug("Application started")
|
|
logging.info("Application started")
|
|
logging.warning("Application started")
|
|
logging.error("Application started")
|
|
logging.critical("Application started")
|