summaryrefslogtreecommitdiffstats
path: root/modules/log/file.go
diff options
context:
space:
mode:
authorGabriel Jackson <gabriel@coffeepowered.co>2017-01-29 12:13:57 -0800
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2017-02-02 15:24:18 +0100
commitbf6f61cc690978bcad416ace8e8da2418602cbf3 (patch)
tree98be4a5abcd53063b41676772b8dd37a47621c44 /modules/log/file.go
parent73d05a51e3dce4a5b31b8660a6141a14ae615404 (diff)
downloadgitea-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 'modules/log/file.go')
-rw-r--r--modules/log/file.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/log/file.go b/modules/log/file.go
index dc243de8d9..fe6c54ec38 100644
--- a/modules/log/file.go
+++ b/modules/log/file.go
@@ -151,7 +151,7 @@ func (w *FileLogWriter) initFd() error {
fd := w.mw.fd
finfo, err := fd.Stat()
if err != nil {
- return fmt.Errorf("get stat: %s", err)
+ return fmt.Errorf("get stat: %v", err)
}
w.maxsizeCursize = int(finfo.Size())
w.dailyOpenDate = time.Now().Day()
@@ -194,12 +194,12 @@ func (w *FileLogWriter) DoRotate() error {
// close fd before rename
// Rename the file to its newfound home
if err = os.Rename(w.Filename, fname); err != nil {
- return fmt.Errorf("Rotate: %s", err)
+ return fmt.Errorf("Rotate: %v", err)
}
// re-start logger
if err = w.StartLogger(); err != nil {
- return fmt.Errorf("Rotate StartLogger: %s", err)
+ return fmt.Errorf("Rotate StartLogger: %v", err)
}
go w.deleteOldLog()
@@ -221,7 +221,7 @@ func (w *FileLogWriter) deleteOldLog() {
if strings.HasPrefix(filepath.Base(path), filepath.Base(w.Filename)) {
if err := os.Remove(path); err != nil {
- returnErr = fmt.Errorf("Fail to remove %s: %v", path, err)
+ returnErr = fmt.Errorf("Failed to remove %s: %v", path, err)
}
}
}