Skip to content

Commit

Permalink
add winston
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel committed Jun 27, 2024
1 parent dd8e2dd commit 7c7f90d
Show file tree
Hide file tree
Showing 4 changed files with 338 additions and 7 deletions.
210 changes: 209 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@
"uuid": "^9.0.1",
"viem": "^2.16.2",
"wagmi": "^2.5.7",
"winston": "^3.13.0",
"winston-transport": "^4.7.0",
"zod": "^3.22.4"
},
"optionalDependencies": {
Expand Down
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 })
}
}
Loading

0 comments on commit 7c7f90d

Please sign in to comment.