From 42b40636991b97fe818007fab19091764fc5db73 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 15 Jul 2022 15:30:14 +0200 Subject: Add ability for client to create server logs --- client/src/app/helpers/i18n-utils.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'client/src/app/helpers/i18n-utils.ts') diff --git a/client/src/app/helpers/i18n-utils.ts b/client/src/app/helpers/i18n-utils.ts index 2017a31ea..b7d73d16b 100644 --- a/client/src/app/helpers/i18n-utils.ts +++ b/client/src/app/helpers/i18n-utils.ts @@ -1,5 +1,6 @@ -import { environment } from '../../environments/environment' import IntlMessageFormat from 'intl-messageformat' +import { logger } from '@root-helpers/logger' +import { environment } from '../../environments/environment' function isOnDevLocale () { return environment.production === false && window.location.search === '?lang=fr' @@ -19,14 +20,14 @@ function prepareIcu (icu: string) { try { return msg.format(context) as string } catch (err) { - if (!alreadyWarned) console.warn('Cannot format ICU %s.', icu, err) + if (!alreadyWarned) logger.warn(`Cannot format ICU ${icu}.`, err) alreadyWarned = true return fallback } } } catch (err) { - console.warn('Cannot build intl message %s.', icu, err) + logger.warn(`Cannot build intl message ${icu}.`, err) return (_context: unknown, fallback: string) => fallback } -- cgit v1.2.3