From 13915758532438a64812808276171d8c6d5567a0 Mon Sep 17 00:00:00 2001 From: kay delaney <45561153+kaydelaney@users.noreply.github.com> Date: Fri, 10 Jul 2020 15:07:04 +0100 Subject: [PATCH] Chore: Removes some unneeded console logging and changes logs to errors (#26235) --- packages/grafana-data/src/dataframe/ArrowDataFrame.ts | 2 +- packages/grafana-data/src/text/sanitize.ts | 2 +- .../src/transformations/matchers/nameMatcher.ts | 2 +- packages/grafana-ui/src/components/Gauge/Gauge.tsx | 2 +- packages/grafana-ui/src/components/Graph/Graph.tsx | 2 +- .../grafana-ui/src/components/Monaco/CodeEditor.tsx | 1 - .../TableInputCSV/TableInputCSV.story.internal.tsx | 1 - .../jaeger-ui-components/src/common/UiFindInput.tsx | 4 ---- public/app/core/components/Login/LoginCtrl.tsx | 2 +- .../TransformersUI/FilterByNameTransformerEditor.tsx | 2 +- public/app/core/components/scroll/scroll.ts | 1 - public/app/core/controllers/signup_ctrl.ts | 2 +- public/app/core/live/live_srv.ts | 11 +---------- public/app/core/services/alert_srv.ts | 2 +- public/app/core/services/bridge_srv.ts | 2 -- .../core/services/echo/backends/PerformanceBackend.ts | 2 +- public/app/core/utils/UserProvider.tsx | 2 +- public/app/core/utils/emitter.ts | 6 +++--- public/app/features/admin/ldap/LdapSyncInfo.tsx | 1 - public/app/features/admin/state/actions.ts | 2 +- public/app/features/annotations/annotations_srv.ts | 2 +- .../components/DashExportModal/DashboardExporter.ts | 2 +- .../dashboard/components/Inspector/InspectJSONTab.tsx | 2 +- .../app/features/dashboard/dashgrid/PanelChrome.tsx | 2 -- .../features/dashboard/services/DashboardLoaderSrv.ts | 2 +- .../app/features/dashboard/state/PanelQueryRunner.ts | 2 +- public/app/features/dashboard/state/initDashboard.ts | 6 +++--- public/app/features/dashboard/state/runRequest.ts | 2 +- public/app/features/dashboard/utils/panel.ts | 2 +- public/app/features/datasources/state/actions.ts | 2 +- public/app/features/explore/QueryRow.tsx | 4 ---- public/app/features/explore/state/actions.ts | 2 +- .../UploadDashboard/uploadDashboardDirective.ts | 2 +- public/app/features/plugins/plugin_component.ts | 2 +- public/app/features/variables/state/actions.ts | 2 +- .../plugins/datasource/dashboard/runSharedRequest.ts | 1 - .../plugins/datasource/elasticsearch/datasource.ts | 2 +- .../editor/KustoQueryField.tsx | 1 - .../grafana-azure-monitor-datasource/query_ctrl.ts | 4 ---- public/app/plugins/datasource/graphite/datasource.ts | 2 +- .../app/plugins/datasource/graphite/graphite_query.ts | 2 +- public/app/plugins/datasource/influxdb/datasource.ts | 6 +++--- public/app/plugins/datasource/influxdb/query_ctrl.ts | 2 +- public/app/plugins/datasource/mssql/datasource.ts | 2 +- public/app/plugins/datasource/mysql/datasource.ts | 2 +- public/app/plugins/datasource/postgres/datasource.ts | 2 +- .../datasource/prometheus/result_transformer.ts | 2 +- public/app/plugins/panel/graph/graph.ts | 2 +- public/app/plugins/panel/graph/module.ts | 1 - .../plugins/panel/heatmap/heatmap_data_converter.ts | 2 +- public/app/routes/GrafanaCtrl.ts | 2 +- 51 files changed, 45 insertions(+), 77 deletions(-) diff --git a/packages/grafana-data/src/dataframe/ArrowDataFrame.ts b/packages/grafana-data/src/dataframe/ArrowDataFrame.ts index 05639b3995d..29bfc35d781 100644 --- a/packages/grafana-data/src/dataframe/ArrowDataFrame.ts +++ b/packages/grafana-data/src/dataframe/ArrowDataFrame.ts @@ -75,7 +75,7 @@ export function arrowTableToDataFrame(table: Table): ArrowDataFrame { break; } default: - console.log('UNKNOWN Type:', schema); + console.error('UNKNOWN Type:', schema); } fields.push({ diff --git a/packages/grafana-data/src/text/sanitize.ts b/packages/grafana-data/src/text/sanitize.ts index c77a7b8fa90..c5c697620a5 100644 --- a/packages/grafana-data/src/text/sanitize.ts +++ b/packages/grafana-data/src/text/sanitize.ts @@ -22,7 +22,7 @@ export function sanitize(unsanitizedString: string): string { try { return sanitizeXSS.process(unsanitizedString); } catch (error) { - console.log('String could not be sanitized', unsanitizedString); + console.error('String could not be sanitized', unsanitizedString); return unsanitizedString; } } diff --git a/packages/grafana-data/src/transformations/matchers/nameMatcher.ts b/packages/grafana-data/src/transformations/matchers/nameMatcher.ts index aad48f285aa..16534ba4638 100644 --- a/packages/grafana-data/src/transformations/matchers/nameMatcher.ts +++ b/packages/grafana-data/src/transformations/matchers/nameMatcher.ts @@ -99,7 +99,7 @@ const patternToRegex = (pattern?: string): RegExp | undefined => { try { return stringToJsRegex(pattern); } catch (error) { - console.log(error); + console.error(error); return undefined; } }; diff --git a/packages/grafana-ui/src/components/Gauge/Gauge.tsx b/packages/grafana-ui/src/components/Gauge/Gauge.tsx index 8d31ec27a8f..4f4f8f24694 100644 --- a/packages/grafana-ui/src/components/Gauge/Gauge.tsx +++ b/packages/grafana-ui/src/components/Gauge/Gauge.tsx @@ -180,7 +180,7 @@ export class Gauge extends PureComponent { try { $.plot(this.canvasElement, [plotSeries], options); } catch (err) { - console.log('Gauge rendering error', err, options, value); + console.error('Gauge rendering error', err, options, value); } } diff --git a/packages/grafana-ui/src/components/Graph/Graph.tsx b/packages/grafana-ui/src/components/Graph/Graph.tsx index 9495fa1096f..7c50ec58888 100644 --- a/packages/grafana-ui/src/components/Graph/Graph.tsx +++ b/packages/grafana-ui/src/components/Graph/Graph.tsx @@ -355,7 +355,7 @@ export class Graph extends PureComponent { flotOptions ); } catch (err) { - console.log('Graph rendering error', err, flotOptions, series); + console.error('Graph rendering error', err, flotOptions, series); throw new Error('Error rendering panel'); } } diff --git a/packages/grafana-ui/src/components/Monaco/CodeEditor.tsx b/packages/grafana-ui/src/components/Monaco/CodeEditor.tsx index 06bcfc0ef3e..8306f992e8b 100644 --- a/packages/grafana-ui/src/components/Monaco/CodeEditor.tsx +++ b/packages/grafana-ui/src/components/Monaco/CodeEditor.tsx @@ -13,7 +13,6 @@ class UnthemedCodeEditor extends React.PureComponent { componentWillUnmount() { if (this.completionCancel) { - console.log('dispose of the custom completion stuff'); this.completionCancel.dispose(); } } diff --git a/packages/grafana-ui/src/components/TableInputCSV/TableInputCSV.story.internal.tsx b/packages/grafana-ui/src/components/TableInputCSV/TableInputCSV.story.internal.tsx index ca4ba226f89..a702a4688a0 100644 --- a/packages/grafana-ui/src/components/TableInputCSV/TableInputCSV.story.internal.tsx +++ b/packages/grafana-ui/src/components/TableInputCSV/TableInputCSV.story.internal.tsx @@ -18,7 +18,6 @@ export const basic = () => { height={'90vh'} text={'a,b,c\n1,2,3'} onSeriesParsed={(data: DataFrame[], text: string) => { - console.log('Data', data, text); action('Data')(data, text); }} /> diff --git a/packages/jaeger-ui-components/src/common/UiFindInput.tsx b/packages/jaeger-ui-components/src/common/UiFindInput.tsx index f37c588bf7e..1745a21dc0c 100644 --- a/packages/jaeger-ui-components/src/common/UiFindInput.tsx +++ b/packages/jaeger-ui-components/src/common/UiFindInput.tsx @@ -38,10 +38,6 @@ export default class UiFindInput extends React.PureComponent { this.props.onChange(''); }; - componentWillUnmount(): void { - console.log('unomuet'); - } - render() { const { allowClear, inputProps, value } = this.props; diff --git a/public/app/core/components/Login/LoginCtrl.tsx b/public/app/core/components/Login/LoginCtrl.tsx index 391fbde17ed..ddb54453121 100644 --- a/public/app/core/components/Login/LoginCtrl.tsx +++ b/public/app/core/components/Login/LoginCtrl.tsx @@ -69,7 +69,7 @@ export class LoginCtrl extends PureComponent { .then(() => { this.toGrafana(); }) - .catch((err: any) => console.log(err)); + .catch((err: any) => console.error(err)); } const resetModel = { diff --git a/public/app/core/components/TransformersUI/FilterByNameTransformerEditor.tsx b/public/app/core/components/TransformersUI/FilterByNameTransformerEditor.tsx index 001005426d8..c1a2c753fe0 100644 --- a/public/app/core/components/TransformersUI/FilterByNameTransformerEditor.tsx +++ b/public/app/core/components/TransformersUI/FilterByNameTransformerEditor.tsx @@ -85,7 +85,7 @@ export class FilterByNameTransformerEditor extends React.PureComponent< } } } catch (error) { - console.log(error); + console.error(error); } } diff --git a/public/app/core/components/scroll/scroll.ts b/public/app/core/components/scroll/scroll.ts index fe7e729bb19..40f0dd0641b 100644 --- a/public/app/core/components/scroll/scroll.ts +++ b/public/app/core/components/scroll/scroll.ts @@ -19,7 +19,6 @@ export function geminiScrollbar() { let scrollRoot = elem.parent(); const scroller = elem; - console.log('scroll'); if (attrs.grafanaScrollbar && attrs.grafanaScrollbar === 'scrollonroot') { scrollRoot = scroller; } diff --git a/public/app/core/controllers/signup_ctrl.ts b/public/app/core/controllers/signup_ctrl.ts index 056f5d21593..c429519efd9 100644 --- a/public/app/core/controllers/signup_ctrl.ts +++ b/public/app/core/controllers/signup_ctrl.ts @@ -15,7 +15,7 @@ export class SignUpCtrl { // validate email is semi ok if (params.email && !params.email.match(/^\S+@\S+$/)) { - console.log('invalid email'); + console.error('invalid email'); return; } diff --git a/public/app/core/live/live_srv.ts b/public/app/core/live/live_srv.ts index 1c761f373b1..634cafe0569 100644 --- a/public/app/core/live/live_srv.ts +++ b/public/app/core/live/live_srv.ts @@ -27,11 +27,9 @@ export class LiveSrv { } this.initPromise = new Promise((resolve, reject) => { - console.log('Live: connecting...'); this.conn = new WebSocket(this.getWebSocketUrl()); this.conn.onclose = (evt: any) => { - console.log('Live: websocket onclose', evt); reject({ message: 'Connection closed' }); this.initPromise = null; @@ -45,11 +43,9 @@ export class LiveSrv { this.conn.onerror = (evt: any) => { this.initPromise = null; reject({ message: 'Connection error' }); - console.log('Live: websocket error', evt); }; this.conn.onopen = (evt: any) => { - console.log('opened'); this.initPromise = null; resolve(this.conn); }; @@ -62,7 +58,7 @@ export class LiveSrv { message = JSON.parse(message); if (!message.stream) { - console.log('Error: stream message without stream!', message); + console.error('Error: stream message without stream!', message); return; } @@ -81,8 +77,6 @@ export class LiveSrv { return; } - console.log('LiveSrv: Reconnecting'); - this.getConnection().then((conn: any) => { _.each(this.observers, (value, key) => { this.send({ action: 'subscribe', stream: key }); @@ -103,7 +97,6 @@ export class LiveSrv { } removeObserver(stream: any, observer: any) { - console.log('unsubscribe', stream); delete this.observers[stream]; this.getConnection().then((conn: any) => { @@ -112,8 +105,6 @@ export class LiveSrv { } subscribe(streamName: string) { - console.log('LiveSrv.subscribe: ' + streamName); - return Observable.create((observer: any) => { this.addObserver(streamName, observer); diff --git a/public/app/core/services/alert_srv.ts b/public/app/core/services/alert_srv.ts index 4995b148abd..ce91fc45150 100644 --- a/public/app/core/services/alert_srv.ts +++ b/public/app/core/services/alert_srv.ts @@ -4,7 +4,7 @@ export class AlertSrv { constructor() {} set() { - console.log('old depricated alert srv being used'); + console.warn('old deprecated alert srv being used'); } } diff --git a/public/app/core/services/bridge_srv.ts b/public/app/core/services/bridge_srv.ts index 25985c75f28..bde6894c1d3 100644 --- a/public/app/core/services/bridge_srv.ts +++ b/public/app/core/services/bridge_srv.ts @@ -80,8 +80,6 @@ export class BridgeSrv { this.$location.replace(); } }); - - console.log('store updating angular $location.url', url); } // Check for template variable changes on a dashboard diff --git a/public/app/core/services/echo/backends/PerformanceBackend.ts b/public/app/core/services/echo/backends/PerformanceBackend.ts index 77d0df69b60..69ae40e2a16 100644 --- a/public/app/core/services/echo/backends/PerformanceBackend.ts +++ b/public/app/core/services/echo/backends/PerformanceBackend.ts @@ -34,7 +34,7 @@ export class PerformanceBackend implements EchoBackend { await getBackendSrv() .put('/api/user', payload) .then(this.loadUser) - .catch(e => console.log(e)) + .catch(e => console.error(e)) .finally(() => { this.setState({ loadingStates: { ...this.state.loadingStates, updateUserProfile: false } }); }); diff --git a/public/app/core/utils/emitter.ts b/public/app/core/utils/emitter.ts index 6d07dc5292e..4c449f81d59 100644 --- a/public/app/core/utils/emitter.ts +++ b/public/app/core/utils/emitter.ts @@ -23,7 +23,7 @@ export class Emitter { emit(event: AppEvent, payload: T): void; emit(event: AppEvent | string, payload?: T | any): void { if (typeof event === 'string') { - console.log(`Using strings as events is deprecated and will be removed in a future version. (${event})`); + console.warn(`Using strings as events is deprecated and will be removed in a future version. (${event})`); this.emitter.emit(event, payload); } else { this.emitter.emit(event.name, payload); @@ -47,7 +47,7 @@ export class Emitter { on(event: AppEvent, handler: (payload: T) => void, scope?: any): void; on(event: AppEvent | string, handler: (payload?: T | any) => void, scope?: any) { if (typeof event === 'string') { - console.log(`Using strings as events is deprecated and will be removed in a future version. (${event})`); + console.warn(`Using strings as events is deprecated and will be removed in a future version. (${event})`); this.emitter.on(event, handler); if (scope) { @@ -83,7 +83,7 @@ export class Emitter { off(event: AppEvent, handler: (payload: T) => void): void; off(event: AppEvent | string, handler: (payload?: T | any) => void) { if (typeof event === 'string') { - console.log(`Using strings as events is deprecated and will be removed in a future version. (${event})`); + console.warn(`Using strings as events is deprecated and will be removed in a future version. (${event})`); this.emitter.off(event, handler); return; } diff --git a/public/app/features/admin/ldap/LdapSyncInfo.tsx b/public/app/features/admin/ldap/LdapSyncInfo.tsx index cbc37de6272..39e256fcceb 100644 --- a/public/app/features/admin/ldap/LdapSyncInfo.tsx +++ b/public/app/features/admin/ldap/LdapSyncInfo.tsx @@ -19,7 +19,6 @@ export class LdapSyncInfo extends PureComponent { }; handleSyncClick = () => { - console.log('Bulk-sync now'); this.setState({ isSyncing: !this.state.isSyncing }); }; diff --git a/public/app/features/admin/state/actions.ts b/public/app/features/admin/state/actions.ts index e90e49b95ce..1f302144e82 100644 --- a/public/app/features/admin/state/actions.ts +++ b/public/app/features/admin/state/actions.ts @@ -37,7 +37,7 @@ export function loadAdminUserPage(userId: number): ThunkResult { } dispatch(userAdminPageLoadedAction(true)); } catch (error) { - console.log(error); + console.error(error); const userError = { title: error.data.message, diff --git a/public/app/features/annotations/annotations_srv.ts b/public/app/features/annotations/annotations_srv.ts index bf6c9980aaa..39127651c3d 100644 --- a/public/app/features/annotations/annotations_srv.ts +++ b/public/app/features/annotations/annotations_srv.ts @@ -62,7 +62,7 @@ export class AnnotationsSrv { if (!err.message && err.data && err.data.message) { err.message = err.data.message; } - console.log('AnnotationSrv.query error', err); + console.error('AnnotationSrv.query error', err); appEvents.emit(AppEvents.alertError, ['Annotation Query Failed', err.message || err]); return []; }); diff --git a/public/app/features/dashboard/components/DashExportModal/DashboardExporter.ts b/public/app/features/dashboard/components/DashExportModal/DashboardExporter.ts index 7f0f0e4fa9c..83298d2ccce 100644 --- a/public/app/features/dashboard/components/DashExportModal/DashboardExporter.ts +++ b/public/app/features/dashboard/components/DashExportModal/DashboardExporter.ts @@ -204,7 +204,7 @@ export class DashboardExporter { return newObj; }) .catch(err => { - console.log('Export failed:', err); + console.error('Export failed:', err); return { error: err, }; diff --git a/public/app/features/dashboard/components/Inspector/InspectJSONTab.tsx b/public/app/features/dashboard/components/Inspector/InspectJSONTab.tsx index ef19f2939f5..f57614423e3 100644 --- a/public/app/features/dashboard/components/Inspector/InspectJSONTab.tsx +++ b/public/app/features/dashboard/components/Inspector/InspectJSONTab.tsx @@ -109,7 +109,7 @@ export class InspectJSONTab extends PureComponent { appEvents.emit(AppEvents.alertSuccess, ['Panel model updated']); } } catch (err) { - console.log('Error applyign updates', err); + console.error('Error applying updates', err); appEvents.emit(AppEvents.alertError, ['Invalid JSON text']); } diff --git a/public/app/features/dashboard/dashgrid/PanelChrome.tsx b/public/app/features/dashboard/dashgrid/PanelChrome.tsx index 84ac07064b4..667c3c78630 100644 --- a/public/app/features/dashboard/dashgrid/PanelChrome.tsx +++ b/public/app/features/dashboard/dashgrid/PanelChrome.tsx @@ -171,7 +171,6 @@ export class PanelChrome extends PureComponent { onRefresh = () => { const { panel, isInView, width } = this.props; if (!isInView) { - console.log('Refresh when panel is visible', panel.id); this.setState({ refreshWhenInView: true }); return; } @@ -181,7 +180,6 @@ export class PanelChrome extends PureComponent { // Issue Query if (this.wantsQueryExecution) { if (width < 0) { - console.log('Refresh skippted, no width yet... wait till we know'); return; } diff --git a/public/app/features/dashboard/services/DashboardLoaderSrv.ts b/public/app/features/dashboard/services/DashboardLoaderSrv.ts index 9a22fd1fe0b..ed503a600e8 100644 --- a/public/app/features/dashboard/services/DashboardLoaderSrv.ts +++ b/public/app/features/dashboard/services/DashboardLoaderSrv.ts @@ -90,7 +90,7 @@ export class DashboardLoaderSrv { }; }, (err: any) => { - console.log('Script dashboard error ' + err); + console.error('Script dashboard error ' + err); this.$rootScope.appEvent(AppEvents.alertError, [ 'Script Error', 'Please make sure it exists and returns a valid dashboard', diff --git a/public/app/features/dashboard/state/PanelQueryRunner.ts b/public/app/features/dashboard/state/PanelQueryRunner.ts index fe39082fc7a..f0f8ea62bb1 100644 --- a/public/app/features/dashboard/state/PanelQueryRunner.ts +++ b/public/app/features/dashboard/state/PanelQueryRunner.ts @@ -177,7 +177,7 @@ export class PanelQueryRunner { this.pipeToSubject(runRequest(ds, request)); } catch (err) { - console.log('PanelQueryRunner Error', err); + console.error('PanelQueryRunner Error', err); } } diff --git a/public/app/features/dashboard/state/initDashboard.ts b/public/app/features/dashboard/state/initDashboard.ts index 741bf64d551..634e883823d 100644 --- a/public/app/features/dashboard/state/initDashboard.ts +++ b/public/app/features/dashboard/state/initDashboard.ts @@ -117,7 +117,7 @@ async function fetchDashboard( } } catch (err) { dispatch(dashboardInitFailed({ message: 'Failed to fetch dashboard', error: err })); - console.log(err); + console.error(err); return null; } } @@ -161,7 +161,7 @@ export function initDashboard(args: InitDashboardArgs): ThunkResult { dashboard = new DashboardModel(dashDTO.dashboard, dashDTO.meta); } catch (err) { dispatch(dashboardInitFailed({ message: 'Failed create dashboard model', error: err })); - console.log(err); + console.error(err); return; } @@ -216,7 +216,7 @@ export function initDashboard(args: InitDashboardArgs): ThunkResult { keybindingSrv.setupDashboardBindings(args.$scope, dashboard); } catch (err) { dispatch(notifyApp(createErrorNotification('Dashboard init failed', err))); - console.log(err); + console.error(err); } if (storeState.dashboard.modifiedQueries) { diff --git a/public/app/features/dashboard/state/runRequest.ts b/public/app/features/dashboard/state/runRequest.ts index f36e60ab278..a1a9b5030e3 100644 --- a/public/app/features/dashboard/state/runRequest.ts +++ b/public/app/features/dashboard/state/runRequest.ts @@ -116,7 +116,7 @@ export function runRequest(datasource: DataSourceApi, request: DataQueryRequest) }), // handle errors catchError(err => { - console.log('runRequest.catchError', err); + console.error('runRequest.catchError', err); return of({ ...state.panelData, state: LoadingState.Error, diff --git a/public/app/features/dashboard/utils/panel.ts b/public/app/features/dashboard/utils/panel.ts index 574ca658620..c19eef0e77b 100644 --- a/public/app/features/dashboard/utils/panel.ts +++ b/public/app/features/dashboard/utils/panel.ts @@ -66,7 +66,7 @@ export const refreshPanel = (panel: PanelModel) => { }; export const toggleLegend = (panel: PanelModel) => { - console.log('Toggle legend is not implemented yet'); + console.warn('Toggle legend is not implemented yet'); // We need to set panel.legend defaults first // panel.legend.show = !panel.legend.show; refreshPanel(panel); diff --git a/public/app/features/datasources/state/actions.ts b/public/app/features/datasources/state/actions.ts index 285768814c9..9d66b201791 100644 --- a/public/app/features/datasources/state/actions.ts +++ b/public/app/features/datasources/state/actions.ts @@ -67,7 +67,7 @@ export const initDataSourceSettings = ( dispatch(initDataSourceSettingsSucceeded(importedPlugin)); } catch (err) { - console.log('Failed to import plugin module', err); + console.error('Failed to import plugin module', err); dispatch(initDataSourceSettingsFailed(err)); } }; diff --git a/public/app/features/explore/QueryRow.tsx b/public/app/features/explore/QueryRow.tsx index 2535d006975..5c28aea5cad 100644 --- a/public/app/features/explore/QueryRow.tsx +++ b/public/app/features/explore/QueryRow.tsx @@ -76,10 +76,6 @@ export class QueryRow extends PureComponent { } }; - componentWillUnmount() { - console.log('QueryRow will unmount'); - } - onClickToggleDisabled = () => { const { exploreId, index, query } = this.props; const newQuery = { diff --git a/public/app/features/explore/state/actions.ts b/public/app/features/explore/state/actions.ts index c4dae5ab462..7922f83bc04 100644 --- a/public/app/features/explore/state/actions.ts +++ b/public/app/features/explore/state/actions.ts @@ -372,7 +372,7 @@ export const loadDatasource = (exploreId: ExploreId, instance: DataSourceApi, or try { instance.init(); } catch (err) { - console.log(err); + console.error(err); } } diff --git a/public/app/features/manage-dashboards/components/UploadDashboard/uploadDashboardDirective.ts b/public/app/features/manage-dashboards/components/UploadDashboard/uploadDashboardDirective.ts index b6bff8c94f2..100657e4b84 100644 --- a/public/app/features/manage-dashboards/components/UploadDashboard/uploadDashboardDirective.ts +++ b/public/app/features/manage-dashboards/components/UploadDashboard/uploadDashboardDirective.ts @@ -30,7 +30,7 @@ export function uploadDashboardDirective(timer: any, $location: ILocationService try { dash = JSON.parse(e.target.result); } catch (err) { - console.log(err); + console.error(err); appEvents.emit(AppEvents.alertError, [ 'Import failed', 'JSON -> JS Serialization failed: ' + err.message, diff --git a/public/app/features/plugins/plugin_component.ts b/public/app/features/plugins/plugin_component.ts index b65f05c81ca..043f5638275 100644 --- a/public/app/features/plugins/plugin_component.ts +++ b/public/app/features/plugins/plugin_component.ts @@ -266,7 +266,7 @@ function pluginDirectiveLoader( registerPluginComponent(scope, elem, attrs, componentInfo); }) .catch((err: any) => { - console.log('Plugin component error', err); + console.error('Plugin component error', err); }); }, }; diff --git a/public/app/features/variables/state/actions.ts b/public/app/features/variables/state/actions.ts index 6e49bfe7c97..143a157bfc7 100644 --- a/public/app/features/variables/state/actions.ts +++ b/public/app/features/variables/state/actions.ts @@ -561,7 +561,7 @@ export const initVariablesTransaction = (dashboardUid: string, dashboard: Dashbo dispatch(variablesCompleteTransaction({ uid: dashboardUid })); } catch (err) { dispatch(notifyApp(createErrorNotification('Templating init failed', err))); - console.log(err); + console.error(err); } }; diff --git a/public/app/plugins/datasource/dashboard/runSharedRequest.ts b/public/app/plugins/datasource/dashboard/runSharedRequest.ts index 4d44686e4d1..3ba345adaf6 100644 --- a/public/app/plugins/datasource/dashboard/runSharedRequest.ts +++ b/public/app/plugins/datasource/dashboard/runSharedRequest.ts @@ -55,7 +55,6 @@ export function runSharedRequest(options: QueryRunnerOptions): Observable { - console.log('runSharedRequest unsubscribe'); subscription.unsubscribe(); }; }); diff --git a/public/app/plugins/datasource/elasticsearch/datasource.ts b/public/app/plugins/datasource/elasticsearch/datasource.ts index 1e6b53ce25a..088a0e3c7ad 100644 --- a/public/app/plugins/datasource/elasticsearch/datasource.ts +++ b/public/app/plugins/datasource/elasticsearch/datasource.ts @@ -315,7 +315,7 @@ export class ElasticDatasource extends DataSourceApi { - console.log(err); + console.error(err); if (err.data && err.data.error) { let message = angular.toJson(err.data.error); if (err.data.error.reason) { diff --git a/public/app/plugins/datasource/grafana-azure-monitor-datasource/editor/KustoQueryField.tsx b/public/app/plugins/datasource/grafana-azure-monitor-datasource/editor/KustoQueryField.tsx index 155f8bbbb63..6bc06a2813b 100644 --- a/public/app/plugins/datasource/grafana-azure-monitor-datasource/editor/KustoQueryField.tsx +++ b/public/app/plugins/datasource/grafana-azure-monitor-datasource/editor/KustoQueryField.tsx @@ -135,7 +135,6 @@ export default class KustoQueryField extends QueryField { } else if (modelPrefix.match(/(database\(\"(\w+)\"\)\.(.+\b)?$)/i)) { typeaheadContext = 'context-database-table'; const db = this.getDBFromDatabaseFunction(modelPrefix); - console.log(db); suggestionGroups = this.getTableSuggestions(db); prefix = prefix.replace('.', ''); diff --git a/public/app/plugins/datasource/grafana-azure-monitor-datasource/query_ctrl.ts b/public/app/plugins/datasource/grafana-azure-monitor-datasource/query_ctrl.ts index 512f21abcad..3ff8cdcb59e 100644 --- a/public/app/plugins/datasource/grafana-azure-monitor-datasource/query_ctrl.ts +++ b/public/app/plugins/datasource/grafana-azure-monitor-datasource/query_ctrl.ts @@ -467,8 +467,6 @@ export class AzureMonitorQueryCtrl extends QueryCtrl { this.replace(this.target.azureMonitor.metricName) ) .then((metadata: any) => { - console.log('Update metadata', metadata); - this.target.azureMonitor.aggregation = metadata.primaryAggType; this.target.azureMonitor.timeGrain = 'auto'; this.target.azureMonitor.allowedTimeGrainsMs = this.convertTimeGrainsToMs(metadata.supportedTimeGrains || []); @@ -527,7 +525,6 @@ export class AzureMonitorQueryCtrl extends QueryCtrl { } azureMonitorAddDimensionFilter() { - console.log('Add dimension', this.target.azureMonitor); this.target.azureMonitor.dimensionFilters.push({ dimension: '', operator: 'eq', @@ -538,7 +535,6 @@ export class AzureMonitorQueryCtrl extends QueryCtrl { azureMonitorRemoveDimensionFilter(index: number) { this.target.azureMonitor.dimensionFilters.splice(index, 1); this.refresh(); - console.log('Remove dimension', index, this.target.azureMonitor); } /* Azure Log Analytics */ diff --git a/public/app/plugins/datasource/graphite/datasource.ts b/public/app/plugins/datasource/graphite/datasource.ts index 6cddee7636c..af3dbfa8089 100644 --- a/public/app/plugins/datasource/graphite/datasource.ts +++ b/public/app/plugins/datasource/graphite/datasource.ts @@ -581,7 +581,7 @@ export class GraphiteDatasource extends DataSourceApi { - console.log('Fetching graphite functions error', err); + console.error('Fetching graphite functions error', err); this.funcDefs = gfunc.getFuncDefs(this.graphiteVersion); return this.funcDefs; }); diff --git a/public/app/plugins/datasource/graphite/graphite_query.ts b/public/app/plugins/datasource/graphite/graphite_query.ts index 759c0fdc67e..cb5c01ecd52 100644 --- a/public/app/plugins/datasource/graphite/graphite_query.ts +++ b/public/app/plugins/datasource/graphite/graphite_query.ts @@ -54,7 +54,7 @@ export default class GraphiteQuery { try { this.parseTargetRecursive(astNode, null); } catch (err) { - console.log('error parsing target:', err.message); + console.error('error parsing target:', err.message); this.error = err.message; this.target.textEditor = true; } diff --git a/public/app/plugins/datasource/influxdb/datasource.ts b/public/app/plugins/datasource/influxdb/datasource.ts index 3c1b225de8e..84db1eb3ce8 100644 --- a/public/app/plugins/datasource/influxdb/datasource.ts +++ b/public/app/plugins/datasource/influxdb/datasource.ts @@ -321,18 +321,18 @@ export default class InfluxDatasource extends DataSourceWithBackend { if (!res || !res.data || res.state !== LoadingState.Done) { - console.log('InfluxDB Error', res); + console.error('InfluxDB Error', res); return { status: 'error', message: 'Error reading InfluxDB' }; } const first = res.data[0]; if (first && first.length) { return { status: 'success', message: `${first.length} buckets found` }; } - console.log('InfluxDB Error', res); + console.error('InfluxDB Error', res); return { status: 'error', message: 'Error reading buckets' }; }) .catch((err: any) => { - console.log('InfluxDB Error', err); + console.error('InfluxDB Error', err); return { status: 'error', message: err.message }; }); } diff --git a/public/app/plugins/datasource/influxdb/query_ctrl.ts b/public/app/plugins/datasource/influxdb/query_ctrl.ts index 44790cb7dec..437e9669f95 100644 --- a/public/app/plugins/datasource/influxdb/query_ctrl.ts +++ b/public/app/plugins/datasource/influxdb/query_ctrl.ts @@ -263,7 +263,7 @@ export class InfluxQueryCtrl extends QueryCtrl { try { this.target.query = this.queryModel.render(false); } catch (err) { - console.log('query render error'); + console.error('query render error'); } this.target.rawQuery = !this.target.rawQuery; } diff --git a/public/app/plugins/datasource/mssql/datasource.ts b/public/app/plugins/datasource/mssql/datasource.ts index 1582b077797..bc35649e963 100644 --- a/public/app/plugins/datasource/mssql/datasource.ts +++ b/public/app/plugins/datasource/mssql/datasource.ts @@ -172,7 +172,7 @@ export class MssqlDatasource { return { status: 'success', message: 'Database Connection OK' }; }) .catch((err: any) => { - console.log(err); + console.error(err); if (err.data && err.data.message) { return { status: 'error', message: err.data.message }; } else { diff --git a/public/app/plugins/datasource/mysql/datasource.ts b/public/app/plugins/datasource/mysql/datasource.ts index 416ca60b40c..111d168a317 100644 --- a/public/app/plugins/datasource/mysql/datasource.ts +++ b/public/app/plugins/datasource/mysql/datasource.ts @@ -190,7 +190,7 @@ export class MysqlDatasource { return { status: 'success', message: 'Database Connection OK' }; }) .catch((err: any) => { - console.log(err); + console.error(err); if (err.data && err.data.message) { return { status: 'error', message: err.data.message }; } else { diff --git a/public/app/plugins/datasource/postgres/datasource.ts b/public/app/plugins/datasource/postgres/datasource.ts index 05b2fb81349..45693d4578e 100644 --- a/public/app/plugins/datasource/postgres/datasource.ts +++ b/public/app/plugins/datasource/postgres/datasource.ts @@ -178,7 +178,7 @@ export class PostgresDatasource { return { status: 'success', message: 'Database Connection OK' }; }) .catch((err: any) => { - console.log(err); + console.error(err); if (err.data && err.data.message) { return { status: 'error', message: err.data.message }; } else { diff --git a/public/app/plugins/datasource/prometheus/result_transformer.ts b/public/app/plugins/datasource/prometheus/result_transformer.ts index 116bc3b26ff..5bd5c435d07 100644 --- a/public/app/plugins/datasource/prometheus/result_transformer.ts +++ b/public/app/plugins/datasource/prometheus/result_transformer.ts @@ -226,7 +226,7 @@ function sortSeriesByLabel(s1: TimeSeries, s2: TimeSeries): number { le1 = parseHistogramLabel(s1.target); le2 = parseHistogramLabel(s2.target); } catch (err) { - console.log(err); + console.error(err); return 0; } diff --git a/public/app/plugins/panel/graph/graph.ts b/public/app/plugins/panel/graph/graph.ts index d6ea5c23187..0b1b8495d86 100644 --- a/public/app/plugins/panel/graph/graph.ts +++ b/public/app/plugins/panel/graph/graph.ts @@ -530,7 +530,7 @@ class GraphElement { delete this.ctrl.error; } } catch (e) { - console.log('flotcharts error', e); + console.error('flotcharts error', e); this.ctrl.error = e.message || 'Render Error'; this.ctrl.renderError = true; } diff --git a/public/app/plugins/panel/graph/module.ts b/public/app/plugins/panel/graph/module.ts index 53d5fa5873a..de7a863dcb8 100644 --- a/public/app/plugins/panel/graph/module.ts +++ b/public/app/plugins/panel/graph/module.ts @@ -253,7 +253,6 @@ export class GraphCtrl extends MetricsPanelCtrl { tip: 'Data exists, but is not timeseries', actionText: 'Switch to table view', action: () => { - console.log('Change from graph to table'); dispatch(changePanelPlugin(this.panel, 'table')); }, }; diff --git a/public/app/plugins/panel/heatmap/heatmap_data_converter.ts b/public/app/plugins/panel/heatmap/heatmap_data_converter.ts index c4d4c60fa0a..7eed3ca967c 100644 --- a/public/app/plugins/panel/heatmap/heatmap_data_converter.ts +++ b/public/app/plugins/panel/heatmap/heatmap_data_converter.ts @@ -59,7 +59,7 @@ function sortSeriesByLabel(s1: { label: string }, s2: { label: string }) { label1 = parseHistogramLabel(s1.label); label2 = parseHistogramLabel(s2.label); } catch (err) { - console.log(err.message || err); + console.error(err.message || err); return 0; } diff --git a/public/app/routes/GrafanaCtrl.ts b/public/app/routes/GrafanaCtrl.ts index 25e1a8e63a2..d16ecfb37ad 100644 --- a/public/app/routes/GrafanaCtrl.ts +++ b/public/app/routes/GrafanaCtrl.ts @@ -101,7 +101,7 @@ export class GrafanaCtrl { let callerScope = this; if (callerScope.$id === 1 && !localScope) { - console.log('warning rootScope onAppEvent called without localscope'); + console.warn('warning rootScope onAppEvent called without localscope'); } if (localScope) { callerScope = localScope;