Log to browser error console automatically, if available.
authorJan Schneider <jan@horde.org>
Wed, 18 Nov 2009 09:17:13 +0000 (10:17 +0100)
committerJan Schneider <jan@horde.org>
Wed, 18 Nov 2009 22:24:01 +0000 (23:24 +0100)
kronolith/js/kronolith.js

index 4b9180b..768b760 100644 (file)
@@ -38,8 +38,8 @@ KronolithCore = {
 
     debug: function(label, e)
     {
-        if (!this.is_logout && Kronolith.conf.debug) {
-            alert(label + ': ' + (e instanceof Error ? e.name + '-' + e.message : Object.inspect(e)));
+        if (!this.is_logout && window.console && window.console.error) {
+            window.console.error(label, Prototype.Browser.Gecko ? e : $H(e).inspect());
         }
     },