From 7b111b6eb08ba209c16f87dc809ee27bb2963f4c Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Sat, 14 Mar 2009 08:55:28 -0600 Subject: [PATCH] Log debug errors to firebug console, if available --- imp/js/src/DimpCore.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/imp/js/src/DimpCore.js b/imp/js/src/DimpCore.js index 4936d2f9b..e4f7751e9 100644 --- a/imp/js/src/DimpCore.js +++ b/imp/js/src/DimpCore.js @@ -33,7 +33,12 @@ DimpCore = { debug: function(label, e) { if (!this.is_logout && DIMP.conf.debug) { - alert(label + ': ' + ((e instanceof Error && e.name && e.message) ? e.name + '-' + e.message : Object.inspect(e)) + (e.lineNumber ? ' (Line #' + e.lineNumber + ')' : '')); + if (console) { + // Firebug error reporting. + console.error(label, e); + } else { + alert(label + ': ' + ((e instanceof Error && e.name && e.message) ? e.name + '-' + e.message : Object.inspect(e)) + (e.lineNumber ? ' (Line #' + e.lineNumber + ')' : '')); + } } }, -- 2.11.0