Show More
@@ -21,10 +21,19 b'' | |||||
21 | """ |
|
21 | """ | |
22 | middleware to handle appenlight publishing of errors |
|
22 | middleware to handle appenlight publishing of errors | |
23 | """ |
|
23 | """ | |
|
24 | import logging | |||
24 |
|
25 | |||
25 | from appenlight_client import make_appenlight_middleware |
|
26 | log = logging.getLogger(__name__) | |
26 | from appenlight_client.exceptions import get_current_traceback |
|
27 | ||
27 | from appenlight_client.wsgi import AppenlightWSGIWrapper |
|
28 | appenlight_installed = False | |
|
29 | ||||
|
30 | try: | |||
|
31 | from appenlight_client import make_appenlight_middleware | |||
|
32 | from appenlight_client.exceptions import get_current_traceback | |||
|
33 | from appenlight_client.wsgi import AppenlightWSGIWrapper | |||
|
34 | appenlight_installed = True | |||
|
35 | except ImportError: | |||
|
36 | log.info('Appenlight packages not present, skipping appenlight setup') | |||
28 |
|
37 | |||
29 |
|
38 | |||
30 | def track_exception(environ): |
|
39 | def track_exception(environ): | |
@@ -63,7 +72,7 b' def wrap_in_appenlight_if_enabled(app, s' | |||||
63 | This is in use to support our setup of the vcs related middlewares. |
|
72 | This is in use to support our setup of the vcs related middlewares. | |
64 |
|
73 | |||
65 | """ |
|
74 | """ | |
66 | if settings['appenlight']: |
|
75 | if appenlight_installed and settings['appenlight']: | |
67 | app = RemoteTracebackTracker(app) |
|
76 | app = RemoteTracebackTracker(app) | |
68 | if not appenlight_client: |
|
77 | if not appenlight_client: | |
69 | app = make_appenlight_middleware(app, settings) |
|
78 | app = make_appenlight_middleware(app, settings) |
General Comments 0
You need to be logged in to leave comments.
Login now