mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-01-31 05:57:33 +00:00
[pino-http] Add new autoLogging flag from v4.3.0 (#37975)
* [pino-http] Add new flag from v4.3.0 See https://github.com/pinojs/pino-http/pull/70 See https://github.com/pinojs/pino-http/releases/tag/v4.3.0 * bump version
This commit is contained in:
parent
9f28d6bb69
commit
022f8a9727
9
types/pino-http/index.d.ts
vendored
9
types/pino-http/index.d.ts
vendored
@ -1,6 +1,7 @@
|
||||
// Type definitions for pino-http 4.0
|
||||
// Type definitions for pino-http 4.3
|
||||
// Project: https://github.com/pinojs/pino-http#readme
|
||||
// Definitions by: Christian Rackerseder <https://github.com/screendriver>
|
||||
// Jeremy Forsythe <https://github.com/jdforsythe>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.7
|
||||
|
||||
@ -15,11 +16,17 @@ declare function PinoHttp(stream?: DestinationStream): PinoHttp.HttpLogger;
|
||||
declare namespace PinoHttp {
|
||||
type HttpLogger = (req: IncomingMessage, res: ServerResponse) => void;
|
||||
|
||||
/**
|
||||
* Options for pino-http
|
||||
*
|
||||
* See https://github.com/pinojs/pino-http#pinohttpopts-stream
|
||||
*/
|
||||
interface Options extends LoggerOptions {
|
||||
logger?: Logger;
|
||||
genReqId?: GenReqId;
|
||||
useLevel?: Level;
|
||||
stream?: DestinationStream;
|
||||
autoLogging?: boolean;
|
||||
customLogLevel?: (res: ServerResponse, error: Error) => Level;
|
||||
}
|
||||
|
||||
|
||||
@ -17,5 +17,6 @@ pinoHttp({ genReqId: (req) => 'foo' });
|
||||
pinoHttp({ genReqId: (req) => Buffer.allocUnsafe(16) });
|
||||
pinoHttp({ useLevel: 'error' });
|
||||
pinoHttp({ prettyPrint: true });
|
||||
pinoHttp({ autoLogging: false });
|
||||
pinoHttp(new Writable());
|
||||
pinoHttp({ customLogLevel(req, res) { return 'info'; } });
|
||||
|
||||
Loading…
Reference in New Issue
Block a user