-
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
Refactor logging #61
Refactor logging #61
Conversation
This is fine for refactoring, but I don't see an API for initializing Nodekit with another logger. |
} | ||
} | ||
|
||
trace(message: string): void; |
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.
do we use trace
and debug
somewhere?
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.
#60 - will be used here. We're gonna have to merge this one first and rebase the opentracing one on top of this.
|
||
export interface NodekitLogger { | ||
info(message: string): void; | ||
info(extra: Dict | undefined, message: string): void; |
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.
Shouldn't message be first argument (for consistency with context class loggers)? Or it would be better to be consistent with pino logger class methods?
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.
The intention was to be consistent with pino
first. I think it makes sense to do this rather than reorder the arguments of every call to the logger.
You probably should coordinate this PR with #60 and decide what should be merged first. |
Yea, we discussed it and agreed that this one should be merged first. |
@melikhov-dev I've added a config option for passing a ready-made logger and added tests for it. Please take a look again. |
@main-kun LGTM |
NodekitLogger
interface to remove direct dependency onpino.Logger
and allow creating context with other loggersPinoLogger
as a default logger implementationlogWarn
method toAppContext
to support warn level logginglogError
to matchlogWarn