mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Better debug message for post form data
Print json format instead of default `%q` Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
This commit is contained in:
parent
905f3336b2
commit
aaf65a47a7
1 changed files with 6 additions and 1 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue