9
나는 다음과 같은 한 로깅 설정 :파이썬/장고 루트 로거 수준
DEBUG south 2011-08-08 11:22:23,847 generic 19539 140735078710464 south execute "..."
I :
이LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'verbose': {
'format': '%(name)s %(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'handlers': {
'null': {
'level': 'DEBUG',
'class':'django.utils.log.NullHandler',
},
'sentry': {
'level': 'DEBUG',
'class': 'sentry.client.handlers.SentryHandler',
'formatter': 'verbose'
},
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'verbose'
}
},
'loggers': {
'django.db.backends': {
'handlers': ['console'],
'level': 'INFO',
'propagate': False,
},
'': {
'level': 'ERROR',
'handlers': ['console'],
},
},
}
manage.py migrate
를 실행 난 아직도 콘솔에서 예를 디버그 물건을 많이 가지고 루트 로거 수준을 ERROR로 설정하면 콘솔에서 오류 메시지 만 예상됩니다. 내가 도대체 뭘 잘못하고있는 겁니까?
import sys
import logging
from django.conf import settings
# Create a dummy handler to use for now.
class NullHandler(logging.Handler):
def emit(self, record):
pass
_logger = logging.getLogger("south")
_logger.addHandler(NullHandler())
_logger.setLevel(logging.DEBUG)
예상대로 _logger.setLevel(logging.DEBUG)
로깅이 작동 제거한 후 : 문제가 south.logger
모듈처럼
UPDATE
보인다.
누군가 저에게 이상한 행동을 설명 할 수 있습니까?
+1 그래서 다른 라이브러리 개발자는 할 수없는 것을 배울 수 있습니다 * – SingleNegationElimination