#!/usr/bin/env python3 from logging import basicConfig, DEBUG, INFO, WARN, ERROR, CRITICAL, getLogger from logging.handlers import TimedRotatingFileHandler from os.path import exists, join, dirname, abspath # Get the full path for this file currentdir = dirname(abspath(__file__)) # Target log file TARGET = join("bbs", join("logs", "enigma-bbs.log")) # Setup logging # DEBUG, INFO, WARN, ERROR, CRITICAL basicConfig( level=INFO, format="%(asctime)s - %(filename)s (%(lineno)d) - %(name)s - %(levelname)s - %(message)s", handlers=[ TimedRotatingFileHandler( filename=join(currentdir, "failUser.log"), when="midnight", backupCount=1, ), #logging.StreamHandler(stream=sys.stdout), ], ) log = getLogger("failUser")