import logging IMPORTANT_LEVEL_NUM = 25 logging.addLevelName(IMPORTANT_LEVEL_NUM, "IMPORTANT") def important(self, message, *args, **kws): if self.isEnabledFor(IMPORTANT_LEVEL_NUM): self._log(IMPORTANT_LEVEL_NUM, message, args, **kws) logging.Logger.important = important logging.basicConfig(level=IMPORTANT_LEVEL_NUM, format='%(asctime)s - %(levelname)s - %(message)s') def get_logger(name): return logging.getLogger(name)