本文介绍了如何禁用django中的南方调试日志记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我在Django中运行我的测试时,失败后我从South获得了几页调试输出,如下所示:
When I run my tests in Django, after a fail I got several pages of debug output from South, like these:
south: DEBUG: south execute "CREATE INDEX "sometable_4d5bad5" ON "video_playable" ("network_id");" with params "[]"
south: DEBUG: south execute "CREATE INDEX "sometable_790e6d98" ON "video_playable" ("published");" with params "[]"
south: DEBUG: south execute "CREATE INDEX "sometable_72312277" ON "video_playable" ("archived");" with params "[]"
所有这些日志记录输出,相关的错误消息丢失垃圾海有没有办法禁用这个输出?
And with all this logging output, the relevant error messages are lost in a sea of garbage. Is there a way to disable this ouput?
推荐答案
把它放在你的代码中。我在 myapp / migrations / __ init __。py
Put this somewhere in your code. I have it in myapp/migrations/__init__.py
import logging
south_logger=logging.getLogger('south')
south_logger.setLevel(logging.INFO)
这篇关于如何禁用django中的南方调试日志记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!