diff options
author | Gabriel Jackson <gabriel@coffeepowered.co> | 2017-01-29 12:13:57 -0800 |
---|---|---|
committer | Kim "BKC" Carlbäcker <kim.carlbacker@gmail.com> | 2017-02-02 15:24:18 +0100 |
commit | bf6f61cc690978bcad416ace8e8da2418602cbf3 (patch) | |
tree | 98be4a5abcd53063b41676772b8dd37a47621c44 /models/models.go | |
parent | 73d05a51e3dce4a5b31b8660a6141a14ae615404 (diff) | |
download | gitea-bf6f61cc690978bcad416ace8e8da2418602cbf3.tar.gz gitea-bf6f61cc690978bcad416ace8e8da2418602cbf3.zip |
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.
Diffstat (limited to 'models/models.go')
-rw-r--r-- | models/models.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/models/models.go b/models/models.go index 1ce704a9e4..7353c11598 100644 --- a/models/models.go +++ b/models/models.go @@ -205,7 +205,7 @@ func getEngine() (*xorm.Engine, error) { return nil, errors.New("this binary version does not build support for SQLite3") } if err := os.MkdirAll(path.Dir(DbCfg.Path), os.ModePerm); err != nil { - return nil, fmt.Errorf("Fail to create directories: %v", err) + return nil, fmt.Errorf("Failed to create directories: %v", err) } connStr = "file:" + DbCfg.Path + "?cache=shared&mode=rwc" case "tidb": @@ -213,7 +213,7 @@ func getEngine() (*xorm.Engine, error) { return nil, errors.New("this binary version does not build support for TiDB") } if err := os.MkdirAll(path.Dir(DbCfg.Path), os.ModePerm); err != nil { - return nil, fmt.Errorf("Fail to create directories: %v", err) + return nil, fmt.Errorf("Failed to create directories: %v", err) } connStr = "goleveldb://" + DbCfg.Path default: @@ -237,7 +237,7 @@ func NewTestEngine(x *xorm.Engine) (err error) { func SetEngine() (err error) { x, err = getEngine() if err != nil { - return fmt.Errorf("Fail to connect to database: %v", err) + return fmt.Errorf("Failed to connect to database: %v", err) } x.SetMapper(core.GonicMapper{}) @@ -247,12 +247,12 @@ func SetEngine() (err error) { logPath := path.Join(setting.LogRootPath, "xorm.log") if err := os.MkdirAll(path.Dir(logPath), os.ModePerm); err != nil { - return fmt.Errorf("Fail to create dir %s: %v", logPath, err) + return fmt.Errorf("Failed to create dir %s: %v", logPath, err) } f, err := os.Create(logPath) if err != nil { - return fmt.Errorf("Fail to create xorm.log: %v", err) + return fmt.Errorf("Failed to create xorm.log: %v", err) } x.SetLogger(xorm.NewSimpleLogger(f)) x.ShowSQL(true) |