pino-http: add customLogLevel option

This commit is contained in:
Oliver Joseph Ash
2019-02-28 16:38:40 +00:00
parent cf06b4f074
commit cd8441d87f
2 changed files with 2 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ declare namespace PinoHttp {
genReqId?: GenReqId;
useLevel?: Level;
stream?: DestinationStream;
customLogLevel?: (res: unknown, error: unknown) => Level
}
interface GenReqId {

View File

@@ -18,3 +18,4 @@ pinoHttp({ genReqId: (req) => Buffer.allocUnsafe(16) });
pinoHttp({ useLevel: 'error' });
pinoHttp({ prettyPrint: true });
pinoHttp(new Writable());
pinoHttp({ customLogLevel(req, res) { return 'info' } });