From 3cc8b7d4a96059d7025da8e367d7743b86f8090d Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 6 Jul 2022 14:04:04 +0100 Subject: [PATCH] Updating logging to typescript to fix build issue. --- packages/backend-core/src/{logging.js => logging.ts} | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) rename packages/backend-core/src/{logging.js => logging.ts} (72%) diff --git a/packages/backend-core/src/logging.js b/packages/backend-core/src/logging.ts similarity index 72% rename from packages/backend-core/src/logging.js rename to packages/backend-core/src/logging.ts index 425d7f8133..68c3307b2f 100644 --- a/packages/backend-core/src/logging.js +++ b/packages/backend-core/src/logging.ts @@ -1,10 +1,10 @@ const NonErrors = ["AccountError"] -function isSuppressed(e) { +function isSuppressed(e?: any) { return e && e["suppressAlert"] } -module.exports.logAlert = (message, e = null) => { +export function logAlert(message: string, e?: any) { if (e && NonErrors.includes(e.name) && isSuppressed(e)) { return } @@ -14,3 +14,7 @@ module.exports.logAlert = (message, e = null) => { } console.error(`bb-alert: ${message} ${errorJson}`) } + +export default { + logAlert, +}