Skip to content

Commit

Permalink
[Lens] comment redux logger (#111513)
Browse files Browse the repository at this point in the history
* [Lens] comment redux logger

* Update x-pack/plugins/lens/public/state_management/index.ts

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>

* Update x-pack/plugins/lens/public/state_management/index.ts

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 9, 2021
1 parent 13f948d commit c6c4f52
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions x-pack/plugins/lens/public/state_management/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { configureStore, getDefaultMiddleware, DeepPartial } from '@reduxjs/toolkit';
import logger from 'redux-logger';
import { createLogger } from 'redux-logger';
import { useDispatch, useSelector, TypedUseSelectorHook } from 'react-redux';
import { lensSlice } from './lens_slice';
import { timeRangeMiddleware } from './time_range_middleware';
Expand Down Expand Up @@ -50,7 +50,14 @@ export const makeConfigureStore = (
optimizingMiddleware(),
timeRangeMiddleware(storeDeps.lensServices.data),
];
if (process.env.NODE_ENV === 'development') middleware.push(logger);
if (process.env.NODE_ENV === 'development') {
middleware.push(
createLogger({
// @ts-ignore
predicate: () => window.ELASTIC_LENS_LOGGER,
})
);
}

return configureStore({
reducer,
Expand Down

0 comments on commit c6c4f52

Please sign in to comment.