Skip to content
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 child method default generic type #1704

Merged
merged 1 commit into from
May 4, 2023
Merged

Conversation

matheusvellone
Copy link
Contributor

@matheusvellone matheusvellone commented May 3, 2023

Closes #1703

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

matheusvellone added a commit to matheusvellone/pino that referenced this pull request May 3, 2023
@matheusvellone
Copy link
Contributor Author

Just force-pushed a change to add test for the type, to avoid bug from comming back

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina merged commit d741fbe into pinojs:master May 4, 2023
16 of 19 checks passed
@@ -80,7 +80,7 @@ interface LoggerExtras<Options = LoggerOptions> extends EventEmitter {
* @param options: an options object that will override child logger inherited options.
* @returns a child logger instance.
*/
child<ChildOptions extends pino.ChildLoggerOptions>(bindings: pino.Bindings, options?: ChildOptions): pino.Logger<Options & ChildOptions>;
child<ChildOptions extends pino.ChildLoggerOptions = {}>(bindings: pino.Bindings, options?: ChildOptions): pino.Logger<Options & ChildOptions>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @matheusvellone, I'm wondering if pino.ChildLoggerOptions would have been a better default or do you have some reservations against it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CustomLevels typing not being repassed to child
3 participants