2024-08-11 18:54:05 -04:00
|
|
|
import logging
|
|
|
|
from logging.handlers import RotatingFileHandler
|
|
|
|
|
|
|
|
logging.basicConfig(
|
|
|
|
level=logging.ERROR,
|
|
|
|
format="%(asctime)s - %(name)s - " "%(levelname)s - %(message)s",
|
|
|
|
datefmt="%Y-%m-%d %H:%M:%S",
|
|
|
|
)
|
|
|
|
|
2024-08-12 21:23:02 -04:00
|
|
|
log_file = "logs/Elysia.log"
|
2024-08-11 18:54:05 -04:00
|
|
|
handler = RotatingFileHandler(log_file, maxBytes=1e6, backupCount=5)
|
|
|
|
formatter = logging.Formatter(
|
|
|
|
"%(asctime)s:%(levelname)s:%(name)s: %(message)s")
|
|
|
|
handler.setFormatter(formatter)
|
|
|
|
|
|
|
|
|
2024-08-12 21:23:02 -04:00
|
|
|
logger = logging.getLogger("Elysia")
|
2024-08-11 18:54:05 -04:00
|
|
|
logger.addHandler(handler)
|
|
|
|
logger.setLevel(logging.INFO)
|