commit d1ca5e272940b24804bb8fa3e70a6359b82dc3ec
parent 827eb9b32ea2d8dc200b4ea021c8040a96917ae1
Author: Dan Stillman <dstillman@zotero.org>
Date: Tue, 24 Mar 2015 03:40:07 -0400
Restore use of dump() on Windows if debug pref is enabled
It turns out that the Cygwin console, unlike -console, is actually
usable, so developers on Windows can use that. Since we sometimes need
real-time debug output from end users (who won't have Cygwin installed),
keep logging to the Browser Console if only the -ZoteroDebug flag is
passed.
Diffstat:
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/chrome/content/zotero/xpcom/debug.js b/chrome/content/zotero/xpcom/debug.js
@@ -25,10 +25,11 @@
Zotero.Debug = new function () {
- var _console, _stackTrace, _store, _level, _time, _lastTime, _output = [];
+ var _console, _consolePref, _stackTrace, _store, _level, _time, _lastTime, _output = [];
this.init = function (forceDebugLog) {
- _console = forceDebugLog || Zotero.Prefs.get('debug.log');
+ _consolePref = Zotero.Prefs.get('debug.log');
+ _console = _consolePref || forceDebugLog;
_store = Zotero.Prefs.get('debug.store');
if (_store) {
Zotero.Prefs.set('debug.store', false);
@@ -89,11 +90,12 @@ Zotero.Debug = new function () {
if (_console) {
var output = 'zotero(' + level + ')' + (_time ? deltaStr : '') + ': ' + message;
if(Zotero.isFx && !Zotero.isBookmarklet) {
- // On Windows, where the text console is inexplicably glacial,
- // log to the Browser Console instead
+ // On Windows, where the text console (-console) is inexplicably glacial,
+ // log to the Browser Console instead if only the -ZoteroDebug flag is used.
+ // Developers can use the debug.log/debug.time prefs and the Cygwin text console.
//
// TODO: Get rid of the filename and line number
- if (Zotero.isWin && !Zotero.isStandalone) {
+ if (!_consolePref && Zotero.isWin && !Zotero.isStandalone) {
var console = Components.utils.import("resource://gre/modules/devtools/Console.jsm", {}).console;
console.log(output);
}