-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
setBindings is no longer available on the typing of FastifyBaseLogger #4344
Comments
👏🏻 to @BlackHole1, @climba03003 and @mcollina. Thanks for addressing this so quickly. |
@silenceisgolden Sorry, we had to revert because this change triggered #4354. until we can think of a better way, you can use the following solution. In declare module "fastify" {
interface FastifyBaseLogger {
setBindings(bindings: import("pino").Bindings): void;
}
} In {
"....": "...",
"include": ["fastify.d.ts"]
} |
@mcollina Will this approach even work?
I guess that my real question is why is |
I don't know, would you like to try a fix in a PR? |
Agreed - I will try to create a commit according to contribution guide lines. |
Prerequisites
Last working version
4.3.0
Stopped working in version
4.8.1
Node.js version
18.x
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
20.04
💥 Regression Report
FastifyLoggerInstance had a method called setBindings that I am using currently to preserve context across multiple log method calls. It looks like FastifyLoggerInstance was replaced with FastifyBaseLogger in #4224, but the typings (at least) show the method as missing when my typecheck runs in my CI checks:
Steps to Reproduce
Sorry that I cannot link to the project, but I think if you have a default simple fastify project that calls
request.log.setBindings()
in 4.3 and upgrade it to 4.8, the type checking should fail with a similar error as above.Expected Behavior
I would expect that this method would be preserved in source code and types unless there was a major version change.
The text was updated successfully, but these errors were encountered: