From f55c2f51ee0dde0b26f141e3e73f6263aebaff92 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 1 Dec 2016 17:30:53 -0500 Subject: [PATCH] Remove extensions.zotero.debug.time and always show interval in output --- chrome/content/zotero/xpcom/debug.js | 29 +++++++++++++--------------- defaults/preferences/zotero.js | 1 - 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/chrome/content/zotero/xpcom/debug.js b/chrome/content/zotero/xpcom/debug.js index 0b80a9e31b..846fcf751a 100644 --- a/chrome/content/zotero/xpcom/debug.js +++ b/chrome/content/zotero/xpcom/debug.js @@ -25,7 +25,7 @@ Zotero.Debug = new function () { - var _console, _consolePref, _stackTrace, _store, _level, _time, _lastTime, _output = []; + var _console, _consolePref, _stackTrace, _store, _level, _lastTime, _output = []; this.init = function (forceDebugLog) { _consolePref = Zotero.Prefs.get('debug.log'); @@ -35,7 +35,6 @@ Zotero.Debug = new function () { Zotero.Prefs.set('debug.store', false); } _level = Zotero.Prefs.get('debug.level'); - _time = forceDebugLog || Zotero.Prefs.get('debug.time'); _stackTrace = Zotero.Prefs.get('debug.stackTrace'); this.storing = _store; @@ -61,20 +60,18 @@ Zotero.Debug = new function () { } var deltaStr = ''; - if (_time || _store) { - var delta = 0; - var d = new Date(); - if (_lastTime) { - delta = d - _lastTime; - } - _lastTime = d; - - while (("" + delta).length < 7) { - delta = '0' + delta; - } - - deltaStr = '(+' + delta + ')'; + var delta = 0; + var d = new Date(); + if (_lastTime) { + delta = d - _lastTime; } + _lastTime = d; + + while (("" + delta).length < 7) { + delta = '0' + delta; + } + + deltaStr = '(+' + delta + ')'; if (stack === true) { // Display stack starting from where this was called @@ -97,7 +94,7 @@ Zotero.Debug = new function () { } if (_console) { - var output = 'zotero(' + level + ')' + (_time ? deltaStr : '') + ': ' + message; + var output = 'zotero(' + level + ')' + deltaStr + ': ' + message; if(Zotero.isFx && !Zotero.isBookmarklet) { // On Windows, where the text console (-console) is inexplicably glacial, // log to the Browser Console instead if only the -ZoteroDebug flag is used. diff --git a/defaults/preferences/zotero.js b/defaults/preferences/zotero.js index 97c79accd5..c3930fe19e 100644 --- a/defaults/preferences/zotero.js +++ b/defaults/preferences/zotero.js @@ -18,7 +18,6 @@ pref("extensions.zotero.debug.store.limit",500000); pref("extensions.zotero.debug.store.submitSize",10000000); pref("extensions.zotero.debug.store.submitLineLength",10000); pref("extensions.zotero.debug.level",5); -pref("extensions.zotero.debug.time", false); pref("extensions.zotero.automaticScraperUpdates",true); pref("extensions.zotero.zoteroDotOrgVersionHeader", true); pref("extensions.zotero.triggerProxyAuthentication", true);