If you’re testing your apps using django-nose and if you have the south database migration app installed, you will notice a high amount of debug messages in the terminal coming from south. This is because south itself sets the level of logging to debug. Unfortunately the south developers are currently not willing to change that.
To silence south, you can write a little nose-plugin, which sets the logging level of south from DEBUG to a level of your choice (e.g. ERROR). To achieve that, simply create a new python module containing the plugin:
from nose.plugins import Plugin import logging class SilenceSouth(Plugin): south_logging_level = logging.ERROR def configure(self, options, conf): super(SilenceSouth, self).configure(options, conf) logging.getLogger('south').setLevel(self.south_logging_level)
You can put nose_plugin.py anywhere in your project folder. In the second step you have to tell nose to use that plugin, and where it is located. To do this, simply add the following lines to the settings.py of your project:
NOSE_PLUGINS = [ '<your_project>.path.to.nose_plugins.SilenceSouth', ]
The result: no more annoying debug messages from south during testing.