2019/02/131 python에서 소스 코드 이름과 라인 번호 출력하기 1234567891011import logging logging.basicConfig(format='%(asctime)s,%(msecs)d %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s', datefmt='%d-%m-%Y:%H:%M:%S', level=logging.DEBUG) logger = logging.getLogger('log_1')logger.debug("This is a debug log")logger.info("This is an info log")logger.critical("This is critical")logger.error("An error occurred")Colored by Color Scriptercs 2019. 2. 13. 이전 1 다음