From c6c4f52fc373e5702eb9452a0d3879bdf06caa2a Mon Sep 17 00:00:00 2001 From: Marta Bondyra Date: Thu, 9 Sep 2021 17:15:44 +0200 Subject: [PATCH] [Lens] comment redux logger (#111513) * [Lens] comment redux logger * Update x-pack/plugins/lens/public/state_management/index.ts Co-authored-by: Marco Liberati * Update x-pack/plugins/lens/public/state_management/index.ts Co-authored-by: Marco Liberati Co-authored-by: Marco Liberati Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- x-pack/plugins/lens/public/state_management/index.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/lens/public/state_management/index.ts b/x-pack/plugins/lens/public/state_management/index.ts index a23a040de2361..1d8f4fdffa730 100644 --- a/x-pack/plugins/lens/public/state_management/index.ts +++ b/x-pack/plugins/lens/public/state_management/index.ts @@ -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'; @@ -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,