Skip to content

Commit

Permalink
Add maxDepth as the third argument to Zotero.debug()
Browse files Browse the repository at this point in the history
varDump(), which is used by Zotero.debug(), defaults to 5
  • Loading branch information
dstillman committed Jan 17, 2017
1 parent a017fe6 commit 786f5ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions chrome/content/zotero/xpcom/debug.js
Expand Up @@ -82,13 +82,13 @@ Zotero.Debug = new function () {
}
}

this.log = function (message, level, stack) {
this.log = function (message, level, maxDepth, stack) {
if (!this.enabled) {
return;
}

if (typeof message != 'string') {
message = Zotero.Utilities.varDump(message);
message = Zotero.Utilities.varDump(message, 0, maxDepth);
}

if (!level) {
Expand Down
5 changes: 3 additions & 2 deletions chrome/content/zotero/xpcom/zotero.js
Expand Up @@ -1031,19 +1031,20 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
*
* @param {} message
* @param {Integer} [level=3]
* @param {Integer} [maxDepth]
* @param {Boolean|Integer} [stack] Whether to display the calling stack.
* If true, stack is displayed starting from the caller. If an integer,
* that many stack levels will be omitted starting from the caller.
*/
function debug(message, level, stack) {
function debug(message, level, maxDepth, stack) {
// Account for this alias
if (stack === true) {
stack = 1;
} else if (stack >= 0) {
stack++;
}

Zotero.Debug.log(message, level, stack);
Zotero.Debug.log(message, level, maxDepth, stack);
}


Expand Down

0 comments on commit 786f5ef

Please sign in to comment.