From fc2ec957fe78900967da26c80817aea8a0bd2c65 Mon Sep 17 00:00:00 2001 From: Julia Rechkunova Date: Thu, 25 Jan 2024 16:58:05 +0100 Subject: [PATCH] [Discover] Disable logging --- .../layout/use_discover_histogram.ts | 6 ++-- .../discover_saved_search_container.ts | 12 -------- .../unified_histogram/public/chart/chart.tsx | 2 +- .../public/container/container.tsx | 2 +- .../public/layout/layout.tsx | 2 +- .../public/services/lens_vis_service.ts | 30 ++++++++++--------- 6 files changed, 22 insertions(+), 32 deletions(-) diff --git a/src/plugins/discover/public/application/main/components/layout/use_discover_histogram.ts b/src/plugins/discover/public/application/main/components/layout/use_discover_histogram.ts index dc760de4f30d9..ac24fc6ccb887 100644 --- a/src/plugins/discover/public/application/main/components/layout/use_discover_histogram.ts +++ b/src/plugins/discover/public/application/main/components/layout/use_discover_histogram.ts @@ -237,13 +237,13 @@ export const useDiscoverHistogram = ({ } const fetchStart = stateContainer.dataState.fetch$.subscribe((value) => { - console.log('fetchStart', value); + // console.log('fetchStart', value); if (!skipRefetch.current) { setIsSuggestionLoading(true); } }); const fetchComplete = textBasedFetchComplete$.subscribe((value) => { - console.log('fetchComplete', value); + // console.log('fetchComplete', value); setIsSuggestionLoading(false); }); @@ -332,7 +332,7 @@ export const useDiscoverHistogram = ({ const onVisContextChanged = useCallback( (newVisContext: ExternalVisContext | undefined) => { - console.log('got new vis context from histogram', newVisContext); + // console.log('got new vis context from histogram', newVisContext); stateContainer.appState.update({ visContext: newVisContext }); }, [stateContainer] diff --git a/src/plugins/discover/public/application/main/services/discover_saved_search_container.ts b/src/plugins/discover/public/application/main/services/discover_saved_search_container.ts index e2021b6b93126..6e9d64141233c 100644 --- a/src/plugins/discover/public/application/main/services/discover_saved_search_container.ts +++ b/src/plugins/discover/public/application/main/services/discover_saved_search_container.ts @@ -269,12 +269,6 @@ export function isEqualSavedSearch(savedSearchPrev: SavedSearch, savedSearchNext const isSame = isEqual(prevValue, nextValue); if (!isSame) { - console.log('changes to saved search detected', { - key, - before: prevSavedSearch[key], - after: nextSavedSearchWithoutSearchSource[key], - }); - addLog('[savedSearch] difference between initial and changed version', { key, before: prevSavedSearch[key], @@ -302,12 +296,6 @@ export function isEqualSavedSearch(savedSearchPrev: SavedSearch, savedSearchNext : isEqual(prevValue, nextValue); if (!isSame) { - console.log('[savedSearch] difference between initial and changed version', { - key, - before: prevValue, - after: nextValue, - }); - addLog('[savedSearch] difference between initial and changed version', { key, before: prevValue, diff --git a/src/plugins/unified_histogram/public/chart/chart.tsx b/src/plugins/unified_histogram/public/chart/chart.tsx index bf1cc09457d97..ae13a3e4b81eb 100644 --- a/src/plugins/unified_histogram/public/chart/chart.tsx +++ b/src/plugins/unified_histogram/public/chart/chart.tsx @@ -175,7 +175,7 @@ export function Chart({ const onSuggestionContextEdit = useCallback( (editedSuggestionContext: UnifiedHistogramSuggestionContext | undefined) => { - console.log('suggestion context was edited', editedSuggestionContext); + // console.log('suggestion context was edited', editedSuggestionContext); lensVisService.onSuggestionEdited({ editedSuggestionContext, }); diff --git a/src/plugins/unified_histogram/public/container/container.tsx b/src/plugins/unified_histogram/public/container/container.tsx index 291bdaed5a3ee..f39835eb372c5 100644 --- a/src/plugins/unified_histogram/public/container/container.tsx +++ b/src/plugins/unified_histogram/public/container/container.tsx @@ -144,7 +144,7 @@ export const UnifiedHistogramContainer = forwardRef< } return (visContext) => { - console.log('updating vis context', visContext); + // console.log('updating vis context', visContext); onVisContextChanged(getStableVisContext(visContext)); }; }, [onVisContextChanged]); diff --git a/src/plugins/unified_histogram/public/layout/layout.tsx b/src/plugins/unified_histogram/public/layout/layout.tsx index de451ac0b5302..875f8e9dd1c89 100644 --- a/src/plugins/unified_histogram/public/layout/layout.tsx +++ b/src/plugins/unified_histogram/public/layout/layout.tsx @@ -244,7 +244,7 @@ export const UnifiedHistogramLayout = ({ useEffect(() => { if (isChartLoading) { - console.log('chart is loading', requestParams.query, externalVisContext); + // console.log('chart is loading', requestParams.query, externalVisContext); return; } diff --git a/src/plugins/unified_histogram/public/services/lens_vis_service.ts b/src/plugins/unified_histogram/public/services/lens_vis_service.ts index 7d1dda22a13ad..3d33a4f2c15aa 100644 --- a/src/plugins/unified_histogram/public/services/lens_vis_service.ts +++ b/src/plugins/unified_histogram/public/services/lens_vis_service.ts @@ -145,11 +145,11 @@ export class LensVisService { }) => { const suggestionContextSelectedPreviously = this.state$.getValue().currentSuggestionContext; - console.log('recalculating chart', queryParams.query, externalVisContext); + // console.log('recalculating chart', queryParams.query, externalVisContext); const allSuggestions = this.getAllSuggestions({ queryParams }); - console.log('service allSuggestions', allSuggestions); + // console.log('service allSuggestions', allSuggestions); const suggestionState = this.getCurrentSuggestionState({ suggestionContextSelectedPreviously, @@ -160,7 +160,7 @@ export class LensVisService { breakdownField, }); - console.log('service suggestionState', suggestionState); + // console.log('service suggestionState', suggestionState); const lensAttributesState = this.getLensAttributesState({ currentSuggestionContext: suggestionState.currentSuggestionContext, @@ -171,7 +171,7 @@ export class LensVisService { breakdownField, }); - console.log('service lensAttributesState', lensAttributesState); + // console.log('service lensAttributesState', lensAttributesState); if (suggestionState.shouldUpdateSelectedSuggestionDueToDepsChange) { onSuggestionContextChange?.(suggestionState.currentSuggestionContext); @@ -182,11 +182,11 @@ export class LensVisService { (suggestionState.shouldUpdateSelectedSuggestionDueToDepsChange || lensAttributesState.shouldUpdateVisContextDueToIncompatibleSuggestion) ) { - console.log( - 'forced to update selected suggestion and vis context', - suggestionState.currentSuggestionContext.suggestion, - lensAttributesState.lensAttributesContext - ); + // console.log( + // 'forced to update selected suggestion and vis context', + // suggestionState.currentSuggestionContext.suggestion, + // lensAttributesState.lensAttributesContext + // ); onVisContextChanged?.(lensAttributesState.lensAttributesContext); } @@ -607,16 +607,18 @@ export class LensVisService { suggestionType === externalVisContext?.suggestionType && isSuggestionAndVisContextCompatible(suggestion, externalVisContext) ) { - console.log('using the external lens attributes'); + // console.log('using the external lens attributes'); + // using the external lens attributes return { shouldUpdateVisContextDueToIncompatibleSuggestion: false, lensAttributesContext: externalVisContext, }; } else { - console.log('external vis is not compatible with the current suggestion'); - console.log('query', currentQuery, externalVisContext.attributes?.state?.query); - console.log('timeInterval', timeInterval, externalVisContext?.requestData?.timeInterval); - console.log('suggestionType', suggestionType, externalVisContext?.suggestionType); + // console.log('external vis is not compatible with the current suggestion'); + // console.log('query', currentQuery, externalVisContext.attributes?.state?.query); + // console.log('timeInterval', timeInterval, externalVisContext?.requestData?.timeInterval); + // console.log('suggestionType', suggestionType, externalVisContext?.suggestionType); + // external vis is not compatible with the current suggestion shouldUpdateVisContextDueToIncompatibleSuggestion = true; } }