Change debug.store.submitLimit to debug.store.submitSize and have it be the number of characters in the output, defaulting to 1 million
This commit is contained in:
parent
15bab1db24
commit
5d92a9c43d
3 changed files with 22 additions and 10 deletions
|
@ -1335,7 +1335,7 @@ Zotero_Preferences.Debug_Output = {
|
|||
|
||||
var url = "https://repo.zotero.org/repo/report?debug=1";
|
||||
var output = Zotero.Debug.get(
|
||||
Zotero.Prefs.get('debug.store.submitLimit'),
|
||||
Zotero.Prefs.get('debug.store.submitSize'),
|
||||
Zotero.Prefs.get('debug.store.submitLineLength')
|
||||
);
|
||||
Zotero_Preferences.Debug_Output.setStore(false);
|
||||
|
|
|
@ -107,24 +107,36 @@ Zotero.Debug = new function () {
|
|||
}
|
||||
|
||||
|
||||
this.get = function (limit, maxLength) {
|
||||
this.get = function (maxChars, maxLineLength) {
|
||||
var output = _output;
|
||||
var total = output.length;
|
||||
|
||||
if (limit && limit < total) {
|
||||
output = output.slice(limit * -1);
|
||||
if (total == 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (maxLength) {
|
||||
if (maxLineLength) {
|
||||
for (var i=0, len=output.length; i<len; i++) {
|
||||
var origLength = output[i].length;
|
||||
if (origLength > maxLength) {
|
||||
output[i] = Zotero.Utilities.ellipsize(output[i], maxLength, true);
|
||||
if (output[i].length > maxLineLength) {
|
||||
output[i] = Zotero.Utilities.ellipsize(output[i], maxLineLength, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return output.join('\n\n');
|
||||
output = output.join('\n\n');
|
||||
|
||||
if (maxChars) {
|
||||
output = output.substr(maxChars * -1);
|
||||
// Cut at two newlines
|
||||
for (var i=1, len=output.length; i<len; i++) {
|
||||
if (output[i] == '\n' && output[i-1] == '\n') {
|
||||
output = output.substr(i + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ pref("extensions.zotero.debug.log",false);
|
|||
pref("extensions.zotero.debug.stackTrace", false);
|
||||
pref("extensions.zotero.debug.store",false);
|
||||
pref("extensions.zotero.debug.store.limit",500000);
|
||||
pref("extensions.zotero.debug.store.submitLimit",100000);
|
||||
pref("extensions.zotero.debug.store.submitSize",1000000);
|
||||
pref("extensions.zotero.debug.store.submitLineLength",10000);
|
||||
pref("extensions.zotero.debug.level",5);
|
||||
pref("extensions.zotero.debug.time", false);
|
||||
|
|
Loading…
Reference in a new issue