commit 25ba8c70063d791b54b4529bf6386c914c3e2fc6
parent 9289b7f4e0129eb055fbd544b641c435ac75a8b7
Author: Dan Stillman <dstillman@zotero.org>
Date: Wed, 2 Nov 2011 16:07:50 -0400
Prepend error info (except other add-ons info) to debug output
Diffstat:
2 files changed, 38 insertions(+), 19 deletions(-)
diff --git a/chrome/content/zotero/xpcom/debug.js b/chrome/content/zotero/xpcom/debug.js
@@ -136,7 +136,10 @@ Zotero.Debug = new function () {
}
}
- return output;
+ return Zotero.getErrors(true).join('\n\n') +
+ "\n\n" + Zotero.getSystemInfo() + "\n\n" +
+ "=========================================================\n\n" +
+ output;
}
diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js
@@ -1208,28 +1208,44 @@ const ZOTERO_CONFIG = {
}
+ /**
+ * Get versions, platform, etc.
+ *
+ * Can be used synchronously or asynchronously; info on other add-ons
+ * is available only in async mode
+ */
function getSystemInfo(callback) {
var appInfo = Components.classes["@mozilla.org/xre/app-info;1"].
getService(Components.interfaces.nsIXULAppInfo);
- Zotero.getInstalledExtensions(function(extensions) {
- var info = {
- version: Zotero.version,
- platform: Zotero.platform,
- oscpu: Zotero.oscpu,
- locale: Zotero.locale,
- appName: appInfo.name,
- appVersion: appInfo.version,
- extensions: extensions.join(', ')
- };
-
- var str = '';
- for (var key in info) {
- str += key + ' => ' + info[key] + ', ';
- }
- str = str.substr(0, str.length - 2);
- callback(str);
- });
+ var info = {
+ version: Zotero.version,
+ platform: Zotero.platform,
+ oscpu: Zotero.oscpu,
+ locale: Zotero.locale,
+ appName: appInfo.name,
+ appVersion: appInfo.version
+ };
+
+ if (callback) {
+ Zotero.getInstalledExtensions(function(extensions) {
+ info.extensions = extensions.join(', ');
+
+ var str = '';
+ for (var key in info) {
+ str += key + ' => ' + info[key] + ', ';
+ }
+ str = str.substr(0, str.length - 2);
+ callback(str);
+ });
+ }
+
+ var str = '';
+ for (var key in info) {
+ str += key + ' => ' + info[key] + ', ';
+ }
+ str = str.substr(0, str.length - 2);
+ return str;
}