Cleanup log messaging

This change corrects a few logging issues:

 * Standardized formatting errors with '%v'.
 * Standardized failure warning word usage.
 * Corrected an instance of using the standard log library when
   the gitea log library should be used instead.
This commit is contained in:
Gabriel Jackson 2017-01-29 12:13:57 -08:00 committed by Kim "BKC" Carlbäcker
parent 73d05a51e3
commit bf6f61cc69
26 changed files with 111 additions and 112 deletions

View file

@ -56,7 +56,7 @@ func setup(logPath string) {
if setting.UseSQLite3 || setting.UseTiDB {
workDir, _ := setting.WorkDir()
if err := os.Chdir(workDir); err != nil {
log.GitLogger.Fatal(4, "Fail to change directory %s: %v", workDir, err)
log.GitLogger.Fatal(4, "Failed to change directory %s: %v", workDir, err)
}
}
@ -134,10 +134,10 @@ func handleUpdateTask(uuid string, user, repoUser *models.User, reponame string,
if err == nil {
resp.Body.Close()
if resp.StatusCode/100 != 2 {
log.GitLogger.Error(2, "Fail to trigger task: not 2xx response code")
log.GitLogger.Error(2, "Failed to trigger task: not 2xx response code")
}
} else {
log.GitLogger.Error(2, "Fail to trigger task: %v", err)
log.GitLogger.Error(2, "Failed to trigger task: %v", err)
}
}
@ -273,7 +273,7 @@ func runServ(c *cli.Context) error {
mode, err := models.AccessLevel(user, repo)
if err != nil {
fail("Internal error", "Fail to check access: %v", err)
fail("Internal error", "Failed to check access: %v", err)
} else if mode < requestedMode {
clientMessage := accessDenied
if mode >= models.AccessModeRead {