Complete Sentry integration (#1546)

This commit is contained in:
Charles Bochet
2023-09-11 15:07:30 -07:00
committed by GitHub
parent 35bcef5090
commit 7621854d4b
13 changed files with 164 additions and 67 deletions

View File

@ -1,11 +1,11 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import { Injectable } from '@nestjs/common';
import { Injectable, LogLevel } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { AwsRegion } from './interfaces/aws-region.interface';
import { StorageType } from './interfaces/storage.interface';
import { SupportDriver } from './interfaces/support.interface';
import { LoggerType } from './interfaces/logger.interface';
import { LoggerDriver } from './interfaces/logger.interface';
@Injectable()
export class EnvironmentService {
@ -122,13 +122,23 @@ export class EnvironmentService {
return this.configService.get<string>('SUPPORT_FRONT_HMAC_KEY');
}
getLoggerDriver(): string {
return (
this.configService.get<string>('LOGGER_DRIVER') ?? LoggerDriver.Console
);
}
getLogLevels(): LogLevel[] {
return (
this.configService.get<LogLevel[]>('LOG_LEVELS') ?? [
'log',
'error',
'warn',
]
);
}
getSentryDSN(): string | undefined {
return this.configService.get<string>('SENTRY_DSN');
}
getLoggerDriver(): string | undefined {
return (
this.configService.get<string>('LOGGER_DRIVER') ?? LoggerType.Console
);
}
}