[cli] Log query params in debug mode

This commit is contained in:
Neeraj Gupta 2024-03-12 14:33:32 +05:30 committed by Neeraj Gupta
parent ddd89aa1d1
commit 51d3238a52

View file

@ -34,6 +34,9 @@ func logRequest(req *resty.Request) {
if len(req.QueryParam) > 0 { if len(req.QueryParam) > 0 {
fmt.Println(color.GreenString("Query Params:")) fmt.Println(color.GreenString("Query Params:"))
for k, v := range req.QueryParam { for k, v := range req.QueryParam {
if k == TokenQuery {
v = []string{"REDACTED"}
}
fmt.Printf("%s: %s\n", color.CyanString(k), color.YellowString(strings.Join(v, ","))) fmt.Printf("%s: %s\n", color.CyanString(k), color.YellowString(strings.Join(v, ",")))
} }
} }