当我这样做时,Logger.error没有打印args:
models.LOGGER.error('ji', {'error_msg':'msg'})
我有一种预感,那就是我的logging.conf文件。根据文件https://docs.python.org/2.7/library/logging.html#logging.Logger.debug
[loggers]
keys=root, appLogger, sentryLogger
[handlers]
keys=consoleHandler
[formatters]
keys=stdFormatter
[logger_root]
level=INFO
handlers=consoleHandler
[logger_appLogger]
level=INFO
handlers=consoleHandler
qualname=appLogger
propagate=0
[logger_sentryLogger]
level=INFO
handlers=consoleHandler
qualname=sentryLogger
propagate=0
[handler_consoleHandler]
class=StreamHandler
level=INFO
formatter=stdFormatter
args=(sys.stdout,)
[formatter_stdFormatter]
format=%(asctime)s - %(name)s: %(levelname)s: %(message)s (%(asctime)s; %(filename)s:%(lineno)d)
datefmt=