개발/Python
python 로그 출력 (logging)
# 테스트 환경 - python 2.7.5 # 설치 pip install logging # 간편 설정 방법 이렇게 하면 간편하긴 한데, 설정 변경이 안된다는 말을 들은 것도 같다. 1 2 3 4 5 6 7 8 9 10 11 import logging logging.basicConfig( filename = 'example.log', filemode = 'w', format = '%(asctime)s(%(levelname)s) %message)s', datefmt = '%Y-%m-%d %H:%M:%S level = logging.INFO ) logging.info('run program') cs # 자세한 설정 방법 파일 설정을 넣어두면 따로 작업하지 않아도 해당 파일에 로그가 쌓인다. (편함) 1 2 3..
2020. 9. 28. 13:25