-
Notifications
You must be signed in to change notification settings - Fork 878
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
TypeScript interface LogFn bugged (e.g. logger.info, logger.debug, etc.) #1782
Comments
Ok, I spent a few hours on this and I think I have a pretty good fix for the bug. I covered every test case that I could think of. |
I just updated the playground to account for functions being passed, which should be disallowed now. I can submit a PR if needed. |
Send it over, thanks! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
The normal usage for Pino is to use one argument, like this:
If you try to use 2 arguments, Pino will use the second argument as a string interpolation argument. However, Pino will silently drop the second argument it if you don't have any
%
signs in your first argument:The TypeScript definitions for Pino are therefore bugged, as the TypeScript compiler does not throw an error when you supply a second argument.
In order to fix this problem, I believe that the type definitions for the function need to be more specific.
The text was updated successfully, but these errors were encountered: