import logging from main import logfile # Setup Logging logging.basicConfig(filename=logfile, encoding="utf-8", filemode="a", format="%(asctime)s %(name)s %(levelname)s %(message)s", datefmt="%Y-%m-%d %H:%M:%S", level=logging.INFO) # Logging handler ## DEBUG (10), INFO (20), WARNING (30), ERROR (40), and CRITICAL (50) def log(msg: str, level=20): logging.log(level=level, msg=msg)