Files
twenty_crm/server/src/integrations/logger/logger.service.ts
brendanlaschke 35bcef5090 Add Sentry for Backend (#1403)
* - added sentry

* - renamed env var

* - logger driver

* - add breadcrumb and category

* - fix driver
2023-09-11 12:22:30 -07:00

45 lines
1.1 KiB
TypeScript

import {
Inject,
Injectable,
LoggerService as ConsoleLoggerService,
} from '@nestjs/common';
import { LOGGER_DRIVER } from './logger.constants';
@Injectable()
export class LoggerService implements ConsoleLoggerService {
constructor(@Inject(LOGGER_DRIVER) private driver: ConsoleLoggerService) {}
log(message: any, category: string, ...optionalParams: any[]) {
this.driver.log.apply(this.driver, [message, category, ...optionalParams]);
}
error(message: any, category: string, ...optionalParams: any[]) {
this.driver.error.apply(this.driver, [
message,
category,
...optionalParams,
]);
}
warn(message: any, category: string, ...optionalParams: any[]) {
this.driver.warn.apply(this.driver, [message, category, ...optionalParams]);
}
debug?(message: any, category: string, ...optionalParams: any[]) {
this.driver.debug?.apply(this.driver, [
message,
category,
...optionalParams,
]);
}
verbose?(message: any, category: string, ...optionalParams: any[]) {
this.driver.verbose?.apply(this.driver, [
message,
category,
...optionalParams,
]);
}
}