summaryrefslogtreecommitdiffstatshomepage
path: root/plugins/weblit/logger.lua
blob: 912b4eed768cc0ace9213d8c8ffb714d68368f5b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
return function (req, res, go)
  -- Skip this layer for clients who don't send User-Agent headers.
  local userAgent = req.headers["user-agent"]
  if not userAgent then return go() end
  -- Run all inner layers first.
  go()
  -- And then log after everything is done
  --print(string.format("%s %s %s %s", req.method,  req.path, userAgent, res.code))
end