Logger

    [Python] Logger 사용법

    [Python] Logger 사용법

    Introduction The Hitchhiker's Guide to Python 이란 책에는 다음과 같은 구절이 등장한다. The only time that print is a better option than logging is when the goal is to display a help statement for a command line application. Shell과 같은 커맨드 인터페이스에서 --help 옵션을 받아 사용법 도움말을 출력할 때 이외에는 항상 logging이 print보다 낫다는 뜻으로, 사실상 웬만한 상황에서는 print 대신 logging을 사용하는 것이 낫다는 의미이다. 그 이유로는 아래와 같은 내용을 들고 있다. The log record, which is create..