From 1d3ef88155f3c477089e98f0f85acda7e6936009 Mon Sep 17 00:00:00 2001 From: Roan Paulus Date: Fri, 7 Feb 2025 10:18:29 +0100 Subject: [PATCH] use logger --- src/server/services/monitoring.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/server/services/monitoring.ts b/src/server/services/monitoring.ts index 5fc4f2d78..ae94aa2ea 100644 --- a/src/server/services/monitoring.ts +++ b/src/server/services/monitoring.ts @@ -88,7 +88,7 @@ export function captureException(error: unknown, properties?: Properties) { if (IS_DEVELOPMENT) { // Does nothing (As expected) if development is not in debug mode. if (IS_DEBUG) { - log.info('Capture Exception', payload); + log.error('Capture Exception', payload); } } else { client?.trackException(payload); @@ -130,13 +130,11 @@ function getSamplePercentage(): number { let samplePercentage = process.env[samplePercentageKey]; if (!samplePercentage) { - // eslint-disable-next-line no-console - console.error( + log.error( `The environment variable ${samplePercentageKey} is not a percentage in the range of 0 up to including 100.` ); samplePercentage = '100'; - // eslint-disable-next-line no-console - console.log(`Defaulted ${samplePercentageKey} to ${samplePercentage}`); + log.error(`Defaulted ${samplePercentageKey} to ${samplePercentage}`); } return parseInt(samplePercentage);