Skip to content

Commit

Permalink
use logger
Browse files Browse the repository at this point in the history
  • Loading branch information
RoanPaulus committed Feb 7, 2025
1 parent 74f2f94 commit 1d3ef88
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/server/services/monitoring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 1d3ef88

Please sign in to comment.