Start logging with ravenjs
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 30 Dec 2013 13:34:09 +0000 (14:34 +0100)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 12 Aug 2014 09:47:11 +0000 (11:47 +0200)
apps/wiki/static/wiki/editor
apps/wiki/templates/wiki/bootstrap.html
redakcja/context_processors.py

index db58e0a..955c8c0 160000 (submodule)
@@ -1 +1 @@
-Subproject commit db58e0a751440706b5e0407e5a4a9ebb6cb0f8aa
+Subproject commit 955c8c0702512cabbdcbe296ae278f5e7ff2f497
index 3bcd262..1e3fa58 100644 (file)
@@ -4,7 +4,12 @@
 <!DOCTYPE html>
 <html>
     <head>
-
+        {% if RAVEN_CONFIG %}
+            <script src="http://cdn.ravenjs.com/1.1.3/jquery,native/raven.min.js"></script>
+            <script>
+                Raven.config('{{RAVEN_CONFIG.SENTRY_URL}}', {{RAVEN_CONFIG.SETTINGS|default:'{}'}}).install();
+            </script>
+        {% endif %}
         <script src="{% url 'django.views.i18n.javascript_catalog' %}"></script>
         <script src="http://cdnjs.cloudflare.com/ajax/libs/ace/1.1.01/ace.js" type="text/javascript" charset="utf-8"></script>
         
             var config = {
                 rootSelector: '#editor_root',
                 jsonifySentPayload: false,
+
+                logging: {
+                    handlers: {
+                        'sentry': {
+                            level: 'info',
+                            handler: 'raven'
+                        }
+                    },
+                    loggers: {
+                        '': {
+                            level: 'info',
+                            handlers: ['sentry']
+                        }
+                    }
+                },
                 
                 documentSaveUrl: function(id) { return '/editor/text/' + id + '/'; },
                 documentHistoryUrl: function(id) { return '/editor/history/' + id + '/'},
index 2724f83..1c268cd 100644 (file)
@@ -16,5 +16,6 @@ def settings(request):
         'MEDIA_URL': settings.MEDIA_URL,
         'STATIC_URL': settings.STATIC_URL,
         'DEBUG': settings.DEBUG,
+        'RAVEN_CONFIG': getattr(settings, 'RAVEN_CONFIG'),
         'APP_VERSION': VERSION,
     }