Fix: Added some code to fix the reconnect/disconnect error. Docs: Added setup.cfg to set everything to be 120.
21 lines
648 B
Python
21 lines
648 B
Python
import logging
|
|
from logging.handlers import RotatingFileHandler
|
|
|
|
# Setup basic configuration
|
|
logging.basicConfig(
|
|
level=logging.ERROR,
|
|
format="%(asctime)s - %(name)s - " "%(levelname)s - %(message)s",
|
|
datefmt="%Y-%m-%d %H:%M:%S",
|
|
)
|
|
|
|
# Create a rotating file handler
|
|
log_file = "nessa.log"
|
|
handler = RotatingFileHandler(log_file, maxBytes=1e6, backupCount=5)
|
|
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
|
handler.setFormatter(formatter)
|
|
|
|
# Configure the logger
|
|
logger = logging.getLogger("Nessa")
|
|
logger.addHandler(handler)
|
|
logger.setLevel(logging.ERROR) # Set to DEBUG for comprehensive logging
|