kafka-python如何关闭debug日志
https://github.com/dpkp/kafka-python/issues/230
在引用kafka的代码里加上以下代码:
import logging import sys logger = logging.getLogger('kafka') logger.addHandler(logging.StreamHandler(sys.stdout)) logger.setLevel(logging.INFO)
即可将日志级别设置为INFO,去掉了大量无用的DEBUG日志