로거를 어떻게 만들어서 모든 모듈에서 사용할 수 있습니까? moduleA이 같은파이썬 글로벌 로깅
뭔가 : moduleB에두고
import logging
import moduleB
log = logging.getLogger('')
result = moduleB.goFigure(5)
log.info('Answer was', result)
: moduleB이 log
이 무엇인지 모르기 때문에 현재
def goFigure(integer):
if not isinstance(integer, int):
log.critical('not an integer')
else:
return integer + 1
, 나는 오류가 발생합니다. 어떻게해야합니까?
대단히 감사합니다. – MFB
이 솔루션은 맞춤형 로거 설정에서도 매력적이었습니다. – Centurion