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 logger instance as third parameter #1977

Merged
merged 1 commit into from
May 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pino.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import type { WorkerOptions } from "worker_threads";
type ThreadStream = any

type TimeFn = () => string;
type MixinFn = (mergeObject: object, level: number) => object;
type MixinFn<CustomLevels extends string = never> = (mergeObject: object, level: number, logger:pino.Logger<CustomLevels>) => object;
type MixinMergeStrategyFn = (mergeObject: object, mixinObject: object) => object;

type CustomLevelLogger<CustomLevels extends string> = { [level in CustomLevels]: LogFn }
Expand Down Expand Up @@ -373,7 +373,7 @@ declare namespace pino {
* is called. The function must synchronously return an object. The properties of the
* returned object will be added to the logged JSON.
*/
mixin?: MixinFn;
mixin?: MixinFn<CustomLevels>;

/**
* If provided, the `mixinMergeStrategy` function is called each time one of the active
Expand Down