mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 16:00:59 +00:00
code refactor and format
This commit is contained in:
parent
7663d50c97
commit
fb5b04506a
@ -238,7 +238,9 @@ func (w *fileLogWriter) lines() (int, error) {
|
||||
// new file name like xx.2013-01-01.2.log
|
||||
func (w *fileLogWriter) doRotate() error {
|
||||
_, err := os.Lstat(w.Filename)
|
||||
if err == nil {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// file exists
|
||||
// Find the next available number
|
||||
num := 1
|
||||
@ -273,9 +275,8 @@ func (w *fileLogWriter) doRotate() error {
|
||||
if renameErr != nil {
|
||||
return fmt.Errorf("Rotate: %s\n", renameErr)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
}
|
||||
|
||||
func (w *fileLogWriter) deleteOldLog() {
|
||||
|
Loading…
Reference in New Issue
Block a user