Merge pull request #33472 from OliverJAsh/oja/pino-http/custom-log-level

pino-http: add `customLogLevel` option
This commit is contained in:
Jesse Trinity
2019-03-01 17:07:20 -08:00
committed by GitHub
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -20,6 +20,7 @@ declare namespace PinoHttp {
genReqId?: GenReqId;
useLevel?: Level;
stream?: DestinationStream;
customLogLevel?: (res: ServerResponse, error: Error) => Level;
}
interface GenReqId {
+1
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'; } });