refactor: update log
This commit is contained in:
parent
be46aa3cff
commit
39206a6d76
1 changed files with 1 additions and 6 deletions
|
|
@ -54,12 +54,7 @@ async function logMiddleware(req: Request, res: Response, next: NextFunction) {
|
||||||
method: req.method,
|
method: req.method,
|
||||||
endpoint: req.url,
|
endpoint: req.url,
|
||||||
responseCode: res.statusCode,
|
responseCode: res.statusCode,
|
||||||
responseDescription:
|
responseDescription: data?.code,
|
||||||
data?.devMessage !== undefined
|
|
||||||
? data.devMessage
|
|
||||||
: { 200: "success", 201: "created_success", 204: "no_content", 304: "success" }[
|
|
||||||
res.statusCode
|
|
||||||
],
|
|
||||||
input: (level === 4 && JSON.stringify(req.body, null, 2)) || undefined,
|
input: (level === 4 && JSON.stringify(req.body, null, 2)) || undefined,
|
||||||
output: (level === 4 && JSON.stringify(data, null, 2)) || undefined,
|
output: (level === 4 && JSON.stringify(data, null, 2)) || undefined,
|
||||||
...req.app.locals.logData,
|
...req.app.locals.logData,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue