logging improved

This commit is contained in:
Christian Müller
2017-09-22 21:31:13 +00:00
parent f56fff61da
commit bd3e4a30af
2 changed files with 2 additions and 3 deletions
+2 -2
View File
@@ -140,7 +140,7 @@ func main() {
c.Logger().Errorf("POST /note error: %d", code)
return c.Render(code, "Note", responsePage(code, err.Error()))
}
c.Logger().Debugf("note %s saved", n.ID)
c.Logger().Infof("note %s saved", n.ID)
return c.Redirect(http.StatusMovedPermanently, "/"+n.ID)
})
@@ -194,7 +194,7 @@ func checkRecaptcha(c echo.Context, captchaResp string) bool {
return false
}
if !respJson.Success {
c.Logger().Errorf("captcha response validation failed: %v", respJson.ErrorCodes)
c.Logger().Warnf("captcha validation failed: %v", respJson.ErrorCodes)
}
return respJson.Success
-1
View File
@@ -124,7 +124,6 @@ func load(c echo.Context, db *sql.DB) (*Note, int) {
var editedVal interface{}
var views int
if err := row.Scan(&id, &text, &published, &editedVal, &password, &views); err != nil {
c.Logger().Error(err)
code := http.StatusNotFound
return responsePage(code), code
}