from logging import getLogger, FileHandler, DEBUGlogger = getLogger(__name__)handler = FileHandler("debug.log")handler.setLevel(DEBUG)logger.setLevel(DEBUG)logger.addHandler(handler)logger.propagate = Falselogger.debug('debug test')