Bug 1487601 - Clean up some logging in FxAccountsCommands. r=markh

This patch fixes an accidental switch-statement fall-through that was
causing `_handleCommands()` to always log "Unknown command", and fixes
an inconsistency where one log line was being sent to the console
rather than the sync log file.

Differential Revision: https://phabricator.services.mozilla.com/D4891

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ryan Kelly 2018-09-03 22:51:13 +00:00
parent cb750b30ec
commit 64ae80b0aa

View File

@ -124,6 +124,7 @@ class FxAccountsCommands {
} catch (e) {
log.error(`Error while handling incoming Send Tab payload.`, e);
}
break;
default:
log.info(`Unknown command: ${command}.`);
}
@ -202,7 +203,7 @@ class SendTab {
name: sender ? sender.name : "",
};
const {title, url: uri} = data.entries[current];
console.log(`Tab received with FxA commands: ${title} from ${tabSender.name}.`);
log.info(`Tab received with FxA commands: ${title} from ${tabSender.name}.`);
Observers.notify("fxaccounts:commands:open-uri", [{uri, title, sender: tabSender}]);
}