23ff4228 by astaxie

if exist file then read lines err

1 parent d99ae3e3
Showing 1 changed file with 2 additions and 2 deletions
...@@ -139,9 +139,9 @@ func (w *FileLogWriter) DoRotate(rotate bool) error { ...@@ -139,9 +139,9 @@ func (w *FileLogWriter) DoRotate(rotate bool) error {
139 w.maxsize_cursize = int(finfo.Size()) 139 w.maxsize_cursize = int(finfo.Size())
140 w.daily_opendate = time.Now().Day() 140 w.daily_opendate = time.Now().Day()
141 if finfo.Size() > 0 { 141 if finfo.Size() > 0 {
142 content, err := ioutil.ReadAll(fd) 142 content, err := ioutil.ReadFile(w.filename)
143 if err != nil { 143 if err != nil {
144 //Do something 144 fmt.Println(err)
145 } 145 }
146 w.maxlines_curlines = len(strings.Split(string(content), "\n")) 146 w.maxlines_curlines = len(strings.Split(string(content), "\n"))
147 147
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!