提交 8c278068 authored 作者: gukai's avatar gukai

优化异步日志

上级 f9e6c9be
...@@ -2,7 +2,6 @@ package logs ...@@ -2,7 +2,6 @@ package logs
import ( import (
"context" "context"
"fmt"
"github.com/gogf/gf/errors/gerror" "github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/frame/g" "github.com/gogf/gf/frame/g"
) )
...@@ -36,12 +35,12 @@ func RequestLog(req RequestLogReq) { ...@@ -36,12 +35,12 @@ func RequestLog(req RequestLogReq) {
//记录info日志 //记录info日志
func Info(path string, format string, v ...interface{}) { func Info(path string, format string, v ...interface{}) {
g.Log().Async().Cat(path).Println(fmt.Sprintf(format, v...)) g.Log().Async().Cat(path).Infof(format, v...)
} }
//记录error日志 //记录error日志
func Error(format string, v ...interface{}) { func Error(format string, v ...interface{}) {
g.Log().Async().Cat("error").Println(fmt.Sprintf(format, v...)) g.Log().Async().Cat("error").Infof(format, v...)
} }
//检查错误 //检查错误
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论