-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(logger): add logger module * feat(logger): add logger to projects module * fix(projects): add adminonly route for all projects * fix(logger): display the full error * feat(logger): use logger on users and ssh keys * feat(logger): add logger to mail * lint: lint files
- Loading branch information
1 parent
177be32
commit bc36574
Showing
10 changed files
with
90 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { ConsoleLogger, Injectable, Scope } from '@nestjs/common'; | ||
|
||
@Injectable({ scope: Scope.TRANSIENT }) | ||
export class CustomLoggerService extends ConsoleLogger { | ||
cError(method: string, message: string, err: unknown): void { | ||
super.error(`{${method}} : ${message}`); | ||
super.error(err); // display the full error after so we dont lose data | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Global, Module } from '@nestjs/common'; | ||
import { CustomLoggerService } from './custom-logger.service'; | ||
|
||
@Global() | ||
@Module({ | ||
providers: [CustomLoggerService], | ||
exports: [CustomLoggerService], | ||
}) | ||
export class LoggerModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
import { Global, Module } from '@nestjs/common'; | ||
import { MailService } from './mail.service'; | ||
import { _InternalMailerService } from './mailer.internal.service'; | ||
import { CustomLoggerService } from 'src/logger/custom-logger.service'; | ||
|
||
@Global() | ||
@Module({ | ||
providers: [MailService, _InternalMailerService], | ||
providers: [MailService, _InternalMailerService, CustomLoggerService], | ||
exports: [MailService], | ||
}) | ||
export class MailModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters