커스텀 로거를 만드는 법을 배우려하고 있습니다. 나는 아래 정확히 오류가 확실하지 않으므로 누구나 나를 올바른 방향으로 인도 할 수 있다면 좋을 것입니다. 사용자 정의 로거 오류입니까?
내가 가져오고 내 launcher.py 파일에서 로거를 실행
...import custom_logging as logging
logging.getLogger(__name__)
는이 오류 얻을 : 내가 아는
No handlers could be found for logger "mb.custom-logger"
을 그 로거의 custom-logger
부분 이름이 custom_logger/__init__.py
파일 내에 있음 ...
... a bunch of code
log = getLogger('mb-logger')
log.warning('Creating log : {0}'.format(log_file))
그러나 mb
부분이 오류 메시지 또는 그와 관련된 부분에서 비롯된 것인지 확실하지 않습니다. 이견있는 사람? 또한
Project_Root/
bin/
launcher.py (this is where the error is occurring)
modules/
custom-logger/
source/
custom_logger/
__init__.py (this is where the custom logger is created)
아마도'__init __. py' 스크립트에서 커스텀 로거가 생성되는 방법을 보여 주어야 할 것입니다. – martineau
[프로젝트의 디렉토리 구조] (http://docs.python-guide.org/en/latest/writing/structure/#structure-of-the-repository) – miraculixx