From 9186c209d9bcd4d23fa0d6dc9ff457a2723ae5ec Mon Sep 17 00:00:00 2001 From: John Date: Sun, 11 Nov 2018 14:21:22 +0800 Subject: [PATCH] =?UTF-8?q?glog=E5=A2=9E=E5=8A=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=8C=87=E9=92=88=E6=B1=A0=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- g/os/glog/glog_logger.go | 5 +++-- geg/net/ghttp/server/template/tpl1/index.html | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/g/os/glog/glog_logger.go b/g/os/glog/glog_logger.go index ed2ea114f..92004d6db 100644 --- a/g/os/glog/glog_logger.go +++ b/g/os/glog/glog_logger.go @@ -11,6 +11,7 @@ import ( "fmt" "gitee.com/johng/gf/g/container/gtype" "gitee.com/johng/gf/g/os/gfile" + "gitee.com/johng/gf/g/os/gfpool" "gitee.com/johng/gf/g/os/gmlock" "gitee.com/johng/gf/g/os/gtime" "gitee.com/johng/gf/g/util/gregex" @@ -127,14 +128,14 @@ func (l *Logger) GetWriter() io.Writer { } // 获取默认的文件IO -func (l *Logger) getFilePointer() *os.File { +func (l *Logger) getFilePointer() *gfpool.File { if path := l.path.Val(); path != "" { // 文件名称中使用"{}"包含的内容使用gtime格式化 file, _ := gregex.ReplaceStringFunc(`{.+?}`, l.file.Val(), func(s string) string { return gtime.Now().Format(strings.Trim(s, "{}")) }) fpath := path + gfile.Separator + file - if fp, err := gfile.OpenWithFlagPerm(fpath, gDEFAULT_FILE_POOL_FLAGS, 0666); err == nil { + if fp, err := gfpool.Open(fpath, gDEFAULT_FILE_POOL_FLAGS, 0666, 60000); err == nil { return fp } else { fmt.Fprintln(os.Stderr, err) diff --git a/geg/net/ghttp/server/template/tpl1/index.html b/geg/net/ghttp/server/template/tpl1/index.html index ec5f48cfc..bebaf5f32 100644 --- a/geg/net/ghttp/server/template/tpl1/index.html +++ b/geg/net/ghttp/server/template/tpl1/index.html @@ -6,6 +6,6 @@

姓名 : {{.name}}

-12345678910 +12 \ No newline at end of file