From: Stas Vilchik Date: Wed, 16 Dec 2015 15:52:51 +0000 (+0100) Subject: use envify to log only in development X-Git-Tag: 5.4-M2~34 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d9e9ce0e057ecf58ccaee9cc5d7c2231b98c0947;p=sonarqube.git use envify to log only in development --- diff --git a/server/sonar-web/package.json b/server/sonar-web/package.json index 53e6738360b..570d3b97d21 100644 --- a/server/sonar-web/package.json +++ b/server/sonar-web/package.json @@ -23,6 +23,7 @@ "clipboard": "1.5.5", "d3": "3.5.6", "del": "2.0.2", + "envify": "^3.4.0", "enzyme": "^1.2.0", "eslint": "^1.10.3", "eslint-plugin-import": "^0.11.0", @@ -85,7 +86,8 @@ "transform": [ "hbsfy", "babelify", - "browserify-shim" + "browserify-shim", + "envify" ] } } diff --git a/server/sonar-web/src/main/js/apps/code/store/configureStore.js b/server/sonar-web/src/main/js/apps/code/store/configureStore.js index 20d1587895a..821c23f5ae0 100644 --- a/server/sonar-web/src/main/js/apps/code/store/configureStore.js +++ b/server/sonar-web/src/main/js/apps/code/store/configureStore.js @@ -4,10 +4,13 @@ import createLogger from 'redux-logger'; import rootReducer from '../reducers'; +const logger = createLogger({ + predicate: () => process.env.NODE_ENV === 'development' +}); const createStoreWithMiddleware = applyMiddleware( thunk, - createLogger() + logger )(createStore);