-
-
Notifications
You must be signed in to change notification settings - Fork 188
自定义日志组件
Joe Zou edited this page Sep 16, 2020
·
7 revisions
复制以下代码至项目中,并在其中引用日志组件的方法进行打印log
type DefaultLogger struct {
}
func (this *DefaultLogger)Debugf(format string, params ...interface{}) {
}
func (this *DefaultLogger)Infof(format string, params ...interface{}) {
}
func (this *DefaultLogger)Warnf(format string, params ...interface{}) error {
return nil
}
func (this *DefaultLogger)Errorf(format string, params ...interface{}) error {
return nil
}
func (this *DefaultLogger)Debug(v ...interface{}) {
}
func (this *DefaultLogger)Info(v ...interface{}){
}
func (this *DefaultLogger)Warn(v ...interface{}) error{
return nil
}
func (this *DefaultLogger)Error(v ...interface{}) error{
return nil
}
func main() {
agollo.SetLogger(&DefaultLogger{})
client,e:=agollo.Start()
}
更多信息:https://github.com/zouyx/agollo_demo/tree/master/custom/log
设计文档
开发文档
基本使用
高级使用