Skip to content

Commit

Permalink
fix log bug when running server
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcosLopezC committed Nov 20, 2022
1 parent 4881027 commit 3bd0724
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ exports.setupLog = function(req, rsp, next){
try{
contentLength = parseInt(rsp._header.split("\n").find(h => h.includes("Content-Length")).split(" ")[1].split("\r")[0])
}catch(e){}
console.log(new Date(), rsp.req.method.green, rsp.statusCode, rsp.req.url, measureBody(contentLength).grey)
console.log(new Date(), req.method.green, rsp.statusCode, req.url, measureBody(contentLength).grey)
})

// var start = process.hrtime()
Expand Down

0 comments on commit 3bd0724

Please sign in to comment.