Add -zoterodebug command-line flag to force debug output

This should make it much easier to debug startup errors, particularly in
Standalone.

This also adds a general mechanism to set Zotero initialization options via
command-line flags.
This commit is contained in:
Dan Stillman 2013-11-30 01:55:48 -05:00
parent 8e276b30d4
commit 6ff0ea6d18
3 changed files with 22 additions and 14 deletions

View file

@ -27,8 +27,8 @@
Zotero.Debug = new function () {
var _console, _stackTrace, _store, _level, _time, _lastTime, _output = [];
this.init = function () {
_console = Zotero.Prefs.get('debug.log');
this.init = function (forceDebugLog) {
_console = forceDebugLog || Zotero.Prefs.get('debug.log');
_store = Zotero.Prefs.get('debug.store');
if (_store) {
Zotero.Prefs.set('debug.store', false);

View file

@ -218,14 +218,18 @@ Components.utils.import("resource://gre/modules/Services.jsm");
/**
* Initialize the extension
*/
function init() {
function init(options) {
if (this.initialized || this.skipLoading) {
return false;
}
// Load in the preferences branch for the extension
Zotero.Prefs.init();
Zotero.Debug.init();
Zotero.Debug.init(options && options.forceDebugLog);
if (options) {
if (options.openPane) this.openPane = true;
}
this.mainThread = Components.classes["@mozilla.org/thread-manager;1"].getService().mainThread;