提交 14216093 authored 作者: 赵雪如's avatar 赵雪如

refactor(log): 注释日志write正则部分

上级 884382f2
...@@ -2,9 +2,7 @@ package log ...@@ -2,9 +2,7 @@ package log
import ( import (
"context" "context"
"fmt"
"github.com/gogf/gf/os/glog" "github.com/gogf/gf/os/glog"
"github.com/gogf/gf/text/gregex"
) )
type MyWriter struct { type MyWriter struct {
...@@ -18,11 +16,11 @@ func init() { ...@@ -18,11 +16,11 @@ func init() {
} }
func (w *MyWriter)Write(p []byte)(n int, err error) { func (w *MyWriter)Write(p []byte)(n int, err error) {
s := string(p) //s := string(p)
if gregex.IsMatchString(`PANI|FATA|ERRO`, s) { //if gregex.IsMatchString(`PANI|FATA|ERRO`, s) {
fmt.Println("SERIOUS ISSUE OCCURRED!! I'd better tell monitor in first time!") // fmt.Println("SERIOUS ISSUE OCCURRED!! I'd better tell monitor in first time!")
//ghttp.PostContent("http://monitor.mydomain.com", s) // //ghttp.PostContent("http://monitor.mydomain.com", s)
} //}
return w.logger.Write(p) return w.logger.Write(p)
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论