-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat : pino child 추가 #224
feat : pino child 추가 #224
Conversation
child 로거를 통해서 추가로그를 봐야하는게 어떤 이점이 있어요? 뭔가 정형화된 audit 로그를 구성하려는 거면 다른 패키지나 다른 구성으로 준비하는게 어떨까 싶어요. |
아하, 매우 유용하겠네요! |
src/logger/logger.interface.ts
Outdated
@@ -8,4 +9,5 @@ export interface Logger { | |||
warn(msgTemplate?: string, ...args: unknown[]): void; | |||
error(msgTemplate?: string, ...args: unknown[]): void; | |||
log(msgTemplate?: string, ...args: unknown[]): void; | |||
child(options: Record<string, unknown>): pino.Logger; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
피노 디펜던시는 구현체에만 존재하고 페블즈 인터페이스는 독립적으로 존재하는 게 본래 의도에 맞습니다.
급한 건이라면 추후 개선해도 괜찮겠지만 아니라면 수정되었으면 해요.
구현체에서 constructor 오버로딩을 통해 child 메소드에서 Logger 타입을 리턴할 수 있을 거 같아 보여요.
테스트도 붙여주시면 좋습니다. (부모 로거와 차일드 로거의 객체가 구분되는가 같은거..)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overloading 해서 사용자가 체이닝 해서 사용하는 방법과
기존 사용성을 유지하는 flat 을 추가 하였습니다.
의견 부탁드려요 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
유용하게 사용할 수 있을 듯 하네요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR 의 종류는 어떤 것인가요?
무엇을 어떻게 변경했나요?
log 가독성을 높이기 위해 pino.child 추가
코드 변경을 이해하기 위한 배경지식이 필요하다면 설명 해주세요.
https://github.com/pinojs/pino
디펜던시 변경이 있나요?
없음
어떻게 테스트 하셨나요?
스모크, 스웨거
코드의 실행결과를 볼 수 있는 로그나 이미지가 있다면 첨부해주세요.