From 96433e8d8fbc25bd813ec8f1b4b204d20af62c6a Mon Sep 17 00:00:00 2001 From: zseeker <675211118@qq.com> Date: Thu, 24 May 2018 12:59:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Eglog=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=8F=B0=E6=89=93=E5=8D=B0=E5=BC=80=E5=85=B3=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E4=B8=80=E5=A4=84=E7=BB=86=E8=8A=82=E9=81=97=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- g/os/glog/glog_logger.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/g/os/glog/glog_logger.go b/g/os/glog/glog_logger.go index 8e97778ed..61ce2c34e 100644 --- a/g/os/glog/glog_logger.go +++ b/g/os/glog/glog_logger.go @@ -109,9 +109,10 @@ func (l *Logger) print(defaultIO io.Writer, s string) { w := l.GetIO() if w == nil { if v := l.getFileByPool(); v != nil { + w = v.File() // 同时输出到文件和终端 @author zseeker if stdprint { - w = io.MultiWriter(v.File(), os.Stdout) + w = io.MultiWriter(w, os.Stdout) } defer v.Close() } else {