Log reason when calling bootstrap methods
This commit is contained in:
parent
6106e379c9
commit
027060ba86
1 changed files with 12 additions and 1 deletions
|
@ -115,7 +115,8 @@ Zotero.Plugins = new function () {
|
|||
async function _callMethod(addon, method, reason) {
|
||||
try {
|
||||
let id = addon.id;
|
||||
Zotero.debug(`Calling bootstrap method '${method}' for plugin ${id} version ${addon.version}`);
|
||||
Zotero.debug(`Calling bootstrap method '${method}' for plugin ${id} `
|
||||
+ `version ${addon.version} with reason ${_getReasonName(reason)}`);
|
||||
|
||||
let scope = scopes.get(id);
|
||||
if (!scope) {
|
||||
|
@ -174,6 +175,16 @@ Zotero.Plugins = new function () {
|
|||
}
|
||||
|
||||
|
||||
function _getReasonName(reason) {
|
||||
for (let i in REASONS) {
|
||||
if (reason == REASONS[i]) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
|
||||
function _unloadScope(id) {
|
||||
scopes.delete(id);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue