[ Python ] custom logging level 만들기
logging level 추가하기. import logging trace = 15 class user(logging.Logger) : def trace(self , msg , *args ,**kwargs ): self.log( trace ,msg , *args ,**kwargs ) logging.setLoggerClass(user) logging.addLevelName(15 , "user") logger = logging.getLogger("test") logger.setLevel("user") ch = logging.StreamHandler() ch.setLevel(logging.DEBUG) logger.addHandler(ch) logger.debug(" debug test") logger.trace..
2019.09.11