This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,13 +27,6 @@ const expressOnFinished = (logger: AckeeLogger, req: AckeeRequest) => (_err: Err
2727 const error = res [ errorSymbol ] ;
2828 const userAgent = req . headers [ 'user-agent' ] ;
2929 const reqOut = `${ res . statusCode } ${ req . method } ${ req . originalUrl } ${ res . time } ms ${ userAgent ? userAgent : '' } ` ;
30- if ( logger . options . ignoredHttpMethods && logger . options . ignoredHttpMethods . includes ( req . method ) ) {
31- // left here for BC
32- return ;
33- }
34- if ( logger . options . skip && logger . options . skip ( req ) ) {
35- return ;
36- }
3730 const standardOutput = {
3831 data : {
3932 req,
@@ -60,7 +53,14 @@ const expressMiddleware: RequestHandler = function(
6053) {
6154 const userAgent = req . headers [ 'user-agent' ] ;
6255 const reqIn = `--- ${ req . method } ${ req . originalUrl } ${ userAgent ? userAgent : '' } ` ;
63- this . debug ( { req, ackId : req . ackId } , `${ reqIn } - Request accepted` ) ;
56+ if ( this . options . ignoredHttpMethods && this . options . ignoredHttpMethods . includes ( req . method ) ) {
57+ // entire method skipped - left here for BC
58+ return next ( ) ;
59+ }
60+ if ( ! this . options . skip || ! this . options . skip ( req ) ) {
61+ // if request not skipped
62+ this . debug ( { req, ackId : req . ackId } , `${ reqIn } - Request accepted` ) ;
63+ }
6464 req . _startAt = process . hrtime ( ) ;
6565 onHeaders ( response , expressOnHeaders ( req , response ) ) ;
6666 onFinished ( response , expressOnFinished ( this , req ) ) ;
You can’t perform that action at this time.
0 commit comments