Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Management commands now log to console by default

This is quite ugly approach, but I was not able to find better one, see
also:

http://stackoverflow.com/questions/12215436/separate-logging-for-management-commands

Fixes #213.
  • Loading branch information...
commit ca25e0d9879f6852a420cdd58a76330a763b2449 1 parent 01dacf6
@nijel authored
Showing with 5 additions and 0 deletions.
  1. +1 −0  manage.py
  2. +4 −0 weblate/settings_example.py
View
1  manage.py
@@ -24,6 +24,7 @@
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "weblate.settings")
+ os.environ['DJANGO_IS_MANAGEMENT_COMMAND'] = '1'
from django.core.management import execute_from_command_line
View
4 weblate/settings_example.py
@@ -268,6 +268,10 @@
}
}
+# Logging of management commands to console
+if os.environ.get('DJANGO_IS_MANAGEMENT_COMMAND', False):
+ LOGGING['loggers']['weblate']['handlers'].append('console')
+
# Machine translation API keys
# Apertium Web Service, register at http://api.apertium.org/register.jsp
Please sign in to comment.
Something went wrong with that request. Please try again.