-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please change the input parameter type of SetDefaultLogger to ILogger #3156
Comments
func handlerLog(ctx context.Context, in *glog.HandlerInput) {
fmt.Println(in.Values...)
}
func main() {
glog.SetDefaultHandler(handlerLog)
glog.Info(nil, "hello worold", "666")
} 貌似可以用这种方法来实现,HandlerInput有调用info error panic方法的一些信息 |
func handlerLog(ctx context.Context, in *glog.HandlerInput) {
fmt.Println(in.Values...)
}
func main() {
glog.SetDefaultHandler(handlerLog)
glog.Info(nil, "hello worold", "666")
} It seems that this method can be used. HandlerInput has some information about calling the info error panic method. |
@shuqingzai @wln32 这里的 由于 如果想使用第三方的日志组件可以参考前面 @wln32 提供的方式来设置自定义的日志打印逻辑。 感谢大家❤️ |
@shuqingzai @wln32 |
同 #2704 ,不理解回复中的强制不允许修改是为什么?可以说明一下理由吗??理论上,用户应该是可以自定义Log,既然有接口 ,比如:我们需要将日志的写入与输出格式统一化为 zap ,方便上层统一采集,现在无法实现
1. What version of
Go
and system type/arch are you using?# -> % go version go version go1.21.3 darwin/amd64
2. What version of
GoFrame
are you using?3. Can this issue be re-produced with the latest release?
是的
4. What did you do?
5. What did you expect to see?
6. What did you see instead?
The text was updated successfully, but these errors were encountered: