www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit b486366fdf0b61561b3befebac8ebff69c7f2f6c
parent 5ddfdec584dae7d9c2e1c3a2a5449b2e7f938558
Author: Dan Stillman <dstillman@zotero.org>
Date:   Thu,  6 Mar 2014 16:23:21 -0500

Log debug output to the Browser Console on Windows

At least for me (in a VM), the text console has always been unusable on
Windows. Logging to the Browser Console is slower than dump() on OS X
and Linux, but on Windows it's much faster.

Diffstat:
Mchrome/content/zotero/xpcom/debug.js | 13++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/xpcom/debug.js b/chrome/content/zotero/xpcom/debug.js @@ -106,7 +106,18 @@ Zotero.Debug = new function () { if (_console) { var output = 'zotero(' + level + ')' + (_time ? deltaStr : '') + ': ' + message; if(Zotero.isFx && !Zotero.isBookmarklet) { - dump(output+"\n\n"); + // On Windows, where the text console is inexplicably glacial, + // log to the Browser Console instead + // + // TODO: Get rid of the filename and line number + if (Zotero.isWin) { + const consoleJSM = Components.utils.import("resource://gre/modules/devtools/Console.jsm", {}); + consoleJSM.console.sendConsoleAPIMessage(output); + } + // Otherwise dump to the text console + else { + dump(output + "\n\n"); + } } else if(window.console) { window.console.log(output); }