printErrLogs function

Future printErrLogs(
  1. Request req,
  2. Response resp,
  3. HTTPException e,
  4. ErrHandler next,
)

Implementation

Future printErrLogs(
  Request req,
  Response resp,
  HTTPException e,
  ErrHandler next,
) async {
  var dateTime = DateTime.now();
  var result = await next(req, resp, e);
  print("[$dateTime] ${req.client?.remoteAddress.host} "
      "${req.method} ${req.uri.path} => ${resp.nativeStatus}");
  return result;
}