-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
samuel
committed
Jun 27, 2024
1 parent
dd8e2dd
commit 7c7f90d
Showing
4 changed files
with
338 additions
and
7 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
34 changes: 28 additions & 6 deletions
34
packages/nestjs-shared/src/lib/module/logger/service/logger.service.ts
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,11 +1,33 @@ | ||
import { Injectable, LoggerService as NestLoggerService } from '@nestjs/common' | ||
import { logger } from './winston.config' | ||
|
||
@Injectable() | ||
export class LoggerService implements NestLoggerService { | ||
log(message: any, ...optionalParams: any[]) {} | ||
fatal(message: any, ...optionalParams: any[]) {} | ||
error(message: any, ...optionalParams: any[]) {} | ||
warn(message: any, ...optionalParams: any[]) {} | ||
debug?(message: any, ...optionalParams: any[]) {} | ||
verbose?(message: any, ...optionalParams: any[]) {} | ||
log(message: string, context: string) { | ||
logger.info(message, { context }) | ||
} | ||
|
||
info(message: string, context: string) { | ||
logger.info(message, { context }) | ||
} | ||
|
||
error(message: string, trace: string, context: string) { | ||
logger.error(message, { context, trace }) | ||
} | ||
|
||
warn(message: string, context: string) { | ||
logger.warn(message, { context }) | ||
} | ||
|
||
debug(message: string, context: string) { | ||
logger.debug(message, { context }) | ||
} | ||
|
||
verbose(message: string, context: string) { | ||
logger.verbose(message, { context }) | ||
} | ||
|
||
fatal(message: string, context: string) { | ||
logger.error(message, { context }) | ||
} | ||
} |
Oops, something went wrong.