Bug 1525406 - Only log actions when desired r=Standard8

Prevents any output coming from the debugger logging actions

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
David Walsh 2019-05-20 11:12:22 +00:00
Родитель d1648e5525
Коммит d51f25b15e
1 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -97,13 +97,15 @@ export function log({ dispatch, getState }: ThunkArgs) {
return (next: any) => (action: any) => {
const asyncMsg = !action.status ? "" : `[${action.status}]`;
if (isTesting() && prefs.logActions) {
// $FlowIgnore
dump(
`[ACTION] ${action.type} ${asyncMsg} - ${serializeAction(action)}\n`
);
} else {
console.log(action, asyncMsg);
if (prefs.logActions) {
if (isTesting()) {
// $FlowIgnore
dump(
`[ACTION] ${action.type} ${asyncMsg} - ${serializeAction(action)}\n`
);
} else {
console.log(action, asyncMsg);
}
}
next(action);