Better debug message for post form data
Print json format instead of default `%q` Signed-off-by: Zhang Wei <zhangwei555@huawei.com> Upstream-commit: aaf65a47a7a6d9e45b77815ea252a302eefe1096 Component: engine
This commit is contained in:
@ -38,7 +38,12 @@ func debugRequestMiddleware(handler httputils.APIFunc) httputils.APIFunc {
|
||||
if _, exists := postForm["password"]; exists {
|
||||
postForm["password"] = "*****"
|
||||
}
|
||||
logrus.Debugf("form data: %q", postForm)
|
||||
formStr, errMarshal := json.Marshal(postForm)
|
||||
if errMarshal == nil {
|
||||
logrus.Debugf("form data: %s", string(formStr))
|
||||
} else {
|
||||
logrus.Debugf("form data: %q", postForm)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user