Commit 23ff4228 authored by astaxie's avatar astaxie

if exist file then read lines err

parent d99ae3e3
...@@ -139,9 +139,9 @@ func (w *FileLogWriter) DoRotate(rotate bool) error { ...@@ -139,9 +139,9 @@ func (w *FileLogWriter) DoRotate(rotate bool) error {
w.maxsize_cursize = int(finfo.Size()) w.maxsize_cursize = int(finfo.Size())
w.daily_opendate = time.Now().Day() w.daily_opendate = time.Now().Day()
if finfo.Size() > 0 { if finfo.Size() > 0 {
content, err := ioutil.ReadAll(fd) content, err := ioutil.ReadFile(w.filename)
if err != nil { if err != nil {
//Do something fmt.Println(err)
} }
w.maxlines_curlines = len(strings.Split(string(content), "\n")) w.maxlines_curlines = len(strings.Split(string(content), "\n"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment