Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

Commit

Permalink
Make interprocess messaging its own level (off by default)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianb committed Sep 25, 2019
1 parent 3e6a98d commit e06baaf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion extension/background/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ this.main = (function() {
} else if (sender.tab.id === recorderTabId) {
senderInfo = "record->";
}
log.debug(`${senderInfo} ${message.type}${propString}`);
log.messaging(`${senderInfo} ${message.type}${propString}`);
if (message.type === "runIntent") {
const desc = intentParser.parse(message.text);
return intentRunner.runIntent(desc);
Expand Down
8 changes: 6 additions & 2 deletions extension/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ this.log = (function() {

const logLevel = buildSettings.logLevel || "debug";

const levels = ["debug", "info", "warn", "error"];
const levels = ["messaging", "debug", "info", "warn", "error"];
if (!levels.includes(logLevel)) {
console.warn("Invalid buildSettings.logLevel:", logLevel);
}
Expand All @@ -27,7 +27,11 @@ this.log = (function() {
}

function stub() {}
exports.debug = exports.info = exports.warn = exports.error = stub;
exports.messaging = exports.debug = exports.info = exports.warn = exports.error = stub;

if (shouldLog.messaging) {
exports.messaging = console.debug;
}

if (shouldLog.debug) {
exports.debug = console.debug;
Expand Down

0 comments on commit e06baaf

Please sign in to comment.