From d51f25b15e30b3b4eb02d223a24c0ef7cac38ce3 Mon Sep 17 00:00:00 2001 From: David Walsh Date: Mon, 20 May 2019 11:12:22 +0000 Subject: [PATCH] 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 --- .../debugger/src/actions/utils/middleware/log.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/devtools/client/debugger/src/actions/utils/middleware/log.js b/devtools/client/debugger/src/actions/utils/middleware/log.js index 61f52318c125..53813d3fcc3a 100644 --- a/devtools/client/debugger/src/actions/utils/middleware/log.js +++ b/devtools/client/debugger/src/actions/utils/middleware/log.js @@ -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);