From 164366ae0da801fd310de432fdcabe0fd4ac9aab Mon Sep 17 00:00:00 2001 From: JessonChan Date: Tue, 12 Jan 2016 22:33:52 +0800 Subject: [PATCH] return error --- logs/file.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/logs/file.go b/logs/file.go index 9ee7f694..b9336a2c 100644 --- a/logs/file.go +++ b/logs/file.go @@ -185,9 +185,10 @@ func (w *fileLogWriter) WriteMsg(msg string, level int) error { buf[17] = byte('0' + t) buf[18] = byte('0' + s - t*10) msg = string(buf[0:]) + msg + "\n" + w.doCheck(len(msg)) - w.fd.Write([]byte(msg)) - return nil + _, err := w.fd.Write([]byte(msg)) + return err } func (w *fileLogWriter) createLogFile() (*os.File, error) {