do not log random errors using Go logger (#2355)

we need to make sure that we print in consistent
format for the logs, remove the unnecessary logs
everywhere used via `log.Print*`
This commit is contained in:
Harshavardhana
2022-10-04 10:39:28 -07:00
committed by GitHub
parent 413870e995
commit f8475af5a6
3 changed files with 12 additions and 16 deletions

View File

@@ -372,20 +372,23 @@ func handleSPA(w http.ResponseWriter, r *http.Request) {
sf.ObjectBrowser = true
err := ValidateEncodedStyles(overridenStyles)
if err != nil {
log.Println(err)
} else {
sf.CustomStyleOB = overridenStyles
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
sf.CustomStyleOB = overridenStyles
sessionID, err := login(consoleCreds, sf)
if err != nil {
log.Println(err)
} else {
cookie := NewSessionCookieForConsole(*sessionID)
http.SetCookie(w, &cookie)
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
cookie := NewSessionCookieForConsole(*sessionID)
http.SetCookie(w, &cookie)
// Allow us to be iframed
w.Header().Del("X-Frame-Options")
}