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
add generic logger to route handler & FastifyRequest #3782
add generic logger to route handler & FastifyRequest #3782
Conversation
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
cc @kibertoad @fox1t @Eomm could you review? |
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.
This should be a non-breaking change. Kudos
Can you please keep targeting |
Hello @mcollina , since I branched out of This is why I would recommend to apply these changes here seperately in |
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.
This should not land on v3.x until there is a matching PR for main.
The types in v4 are significantly more enchanced. |
remove unnecessary type decleration Co-authored-by: Maksim Sinik <maksim@sinik.it>
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
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Checklist
npm run test
andnpm run benchmark
and the Code of conduct
Initiated by this bug: #3775
I created a PR to fix the typings for the routeHandlers by using the
FastifyRequest
with a generic logger type.As in the docs mentioned: https://www.fastify.io/docs/latest/Reference/Logging/#logging
However with the implemented type definitions it is not possible to use a custom LoggerInstance as the log property was only restricted to be of type
FastifyLoggerInstance
and no generic.This is somewhat of an urgent bugfix from our side as it blocks our development and migration from express to fastify. This is also the reason why we set the PR against this branch as we hope to see the fix already in version 3.x. and help other developers as well.