-
Notifications
You must be signed in to change notification settings - Fork 897
fix: stricter type #1297
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: stricter type #1297
Conversation
The CI failure is actually not related to my changes. |
@@ -90,6 +91,7 @@ pino({ | |||
}); | |||
|
|||
pino({ base: null }); | |||
// @ts-expect-error | |||
if ("pino" in log) console.log(`pino version: ${log.pino}`); |
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.
Not sure why it is inside the type check.
I cannot find the relevant code in js.
Should we update the doc? |
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
I don't know which file is appropriate for the update. Currently, |
Ah don't worry then. Let's just wait for @kibertoad. |
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 looks great!
I believe that this broke something. Basically, const logger = pino({
customLevels: {
warning: 400,
},
useOnlyCustomLevels: true,
});
const child = logger.child({whatever:true});
// Type error.
child.warning("Hello there"); This was not the case before. EDIT: |
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. |
Fixes #1293
Notable Changes:
Record<string, any>
fromLogger
.tsconfig.json
, I think the currentinclude
should beexclude
because it should not compile thetest
file which may contain error.customLevels
options and combine it withLogger
.I think it can provide even more stricter type on the
options
likeuseOnlyCustomLevels
,level
, etc. But it require a heavy refactor and times.