Skip to content

Commit 4f9e5a6

Browse files
authoredSep 17, 2022
fix: correct type of args passed to hooks.logMethod (#1558)
1 parent 7962c76 commit 4f9e5a6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎pino.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ declare namespace pino {
600600
* log method and method is the log method itself, and level is the log level. This hook must invoke the method function by
601601
* using apply, like so: method.apply(this, newArgumentsArray).
602602
*/
603-
logMethod?: (this: Logger, args: any[], method: LogFn, level: number) => void;
603+
logMethod?: (this: Logger, args: Parameters<LogFn>, method: LogFn, level: number) => void;
604604
};
605605

606606
/**

‎test/types/pino.test-d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ const withHooks = pino({
230230
hooks: {
231231
logMethod(args, method, level) {
232232
expectType<pino.Logger>(this);
233-
return method.apply(this, ['msg', ...args]);
233+
return method.apply(this, args);
234234
},
235235
},
236236
});

0 commit comments

Comments
 (0)
Please sign in to comment.