import logging logging.basicConfig( level=logging.INFO, format="[%(asctime)s - %(levelname)s] - %(name)s - %(message)s", datefmt="%d-%b-%y %H:%M:%S", handlers=[ logging.FileHandler("/tmp/log.txt"), logging.StreamHandler(), ], ) logging.getLogger("httpx").setLevel(logging.ERROR) logging.getLogger("pymongo").setLevel(logging.ERROR) logging.getLogger("pyrogram").setLevel(logging.ERROR) logging.getLogger("pytgcalls").setLevel(logging.ERROR) def LOGGER(name: str) -> logging.Logger: return logging.getLogger(name)