diff --git a/src/logging.ts b/src/logging.ts index 793cdd0f..8e9ada04 100644 --- a/src/logging.ts +++ b/src/logging.ts @@ -1,4 +1,5 @@ /* eslint-disable no-console */ +import { debounce } from "custom-card-helpers"; import { version } from "../package.json"; // Log Version @@ -9,10 +10,10 @@ console.groupCollapsed( console.log("Readme:", "https://github.com/ulic75/power-flow-card"); console.groupEnd(); -export function logError(error: string) { +export const logError = debounce((error: string) => { console.log( `%c⚡ Power Flow Card v${version} %cError: ${error}`, "color: #488fc2; font-weight: bold", "color: #b33a3a; font-weight: normal" ); -} +}, 500);