-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fix: typescript tests pino v9.8.0 msgPrefix property #6286
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
Conversation
jsumners
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.
I don't know what this TypeScript stuff is trying to do, but we shouldn't have to pin the pino dependency and extra features of Pino shouldn't ever break anything here. Fastify is quite clear what it expects a logger to minimally look like. That doesn't mean any logger that meets that minimum requirement can't have its own feature set.
mcollina
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.
lgtm
well then it should also be fixed on pino's side right? AFAIU pino made a breaking type change? |
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.
lgtm for fixing the CI
A feature was added to Pino that allows the user to retrieve the configured "message prefix" for the current logger instance (root, child, etc). See pinojs/pino@4605454. This is not a breaking change. It is a new feature that has no bearing any of the logger methods ( Lines 48 to 73 in b84733e
|
|
I see, thanks for the explanation Well, I think the problem is here: /**
* Get `msgPrefix` of the logger instance.
*
* See {@link https://github.com/pinojs/pino/blob/main/docs/api.md#msgprefix-string}.
*/
get msgPrefix(): string | undefined;It should be something like: /**
* Get `msgPrefix` of the logger instance.
*
* See {@link https://github.com/pinojs/pino/blob/main/docs/api.md#msgprefix-string}.
*/
readonly msgPrefix?: string;But we lose the getter specification The type change is breaking (in the sense that it breaks our tests) |
|
We can either do this PR or change the type definition, I'm fine with either |
|
Here is the PR to update the type definition #6287. I can close out this PR if that is the approach we want to take |
Checklist
typescript tests are failing because
pino v9.8.0introducedmsgPrefixin this PR pinojs/pino#2232pin pino to v9.8.0
fixes typescript tests
run
npm run test && npm run benchmark --if-presenttests and/or benchmarks are included
commit message and code follows the Developer's Certification of Origin
and the Code of conduct