-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fix: update typescript pino type to pick #6287
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
fix: update typescript pino type to pick #6287
Conversation
gurgunday
left a comment
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.
No strong opinions, maybe Picking from pino is indeed better for types?
|
This has now created another issue where we cannot use a const app = fastify()
something(app.log)
// ^
// Argument of type 'FastifyBaseLogger' is not assignable to parameter of type 'BaseLogger'.
function something(logger: BaseLogger) {
logger.info('Hello, world!')
}From my understandings, this change comes from #6286 where typescript correctly warned that fastify CI was missing a field to match the new structure of BaseLogger. Ihmo, this PR should be reverted and #6286 should be merged instead. |
|
Fastify uses a generic logger interface that requires a limited set of methods: This PR fixes this issue: we don't want to mock the pino interface, we want to ship pino included. As general fix, I suggest to don't use module's logger in the code This simplify these kind of changes.
ATM we follow the principale like the |
|
@Eomm |
Checklist
updates typescript pino type to pick
npm run test && npm run benchmark --if-presentand the Code of conduct