X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/07fe485fb0a119fb87f8ec948185b5acdd65300e..c8c6b98a7b2a365878871131e0f42c40d6b499fc:/forum/modules/__init__.py diff --git a/forum/modules/__init__.py b/forum/modules/__init__.py index f17d003..07cbc6e 100644 --- a/forum/modules/__init__.py +++ b/forum/modules/__init__.py @@ -1,6 +1,7 @@ import os import types import re +import logging from django.template import Template, TemplateDoesNotExist from django.conf import settings @@ -26,11 +27,13 @@ def get_modules_script(script_name): try: all.append(__import__('%s.%s' % (m.__name__, script_name), globals(), locals(), [m.__name__])) except ImportError, e: - #repr(type(e)) + m.__name__ + ":" + str(e) + #print repr(type(e)) + m.__name__ + ":" + str(e) pass except: - import sys, traceback - traceback.print_exc(file=sys.stdout) + import traceback + logging.error("Error importing %s from module %s: \n %s" % ( + script_name, m.__name__, traceback.format_exc() + )) return all @@ -104,3 +107,5 @@ def module_templates_loader(name, dirs=None): raise TemplateDoesNotExist, name module_templates_loader.is_usable = True + +from decorators import decorate