From 7b94ccb01ff27e355039ee8901c0f9f8aa382d33 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 30 Aug 2024 15:45:51 -0700 Subject: [PATCH] Use logger for validate widget errors --- src/utils/proxy/validate-widget-data.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/proxy/validate-widget-data.js b/src/utils/proxy/validate-widget-data.js index a1e41acf6..8f865fe26 100644 --- a/src/utils/proxy/validate-widget-data.js +++ b/src/utils/proxy/validate-widget-data.js @@ -1,5 +1,8 @@ /* eslint-disable no-console */ import widgets from "widgets/widgets"; +import createLogger from "utils/logger"; + +const logger = createLogger("validateWidgetData"); export default function validateWidgetData(widget, endpoint, data) { let valid = true; @@ -33,7 +36,7 @@ export default function validateWidgetData(widget, endpoint, data) { } if (!valid) { - console.warn( + logger.error( `Invalid data for widget '${widget.type}' endpoint '${endpoint}':\nExpected:${mapping?.validate}\nParse error: ${ error ?? "none" }\nData: ${JSON.stringify(data)}`,