mirror of
https://gitee.com/johng/gf
synced 2026-06-30 19:17:30 +08:00
调整服务注册时不符合接口定义的错误日志方式: glog.Warning->glog.Error
This commit is contained in:
@ -46,7 +46,7 @@ func (s *Server)BindController(pattern string, c Controller, methods...string) e
|
||||
if _, ok := v.Method(i).Interface().(func()); !ok {
|
||||
if methodMap != nil {
|
||||
s := fmt.Sprintf(`invalid medthod definition "%s", while "func()" is required`, v.Method(i).Type().String())
|
||||
glog.Warning(s)
|
||||
glog.Error(s)
|
||||
return errors.New(s)
|
||||
}
|
||||
continue
|
||||
@ -97,7 +97,7 @@ func (s *Server)BindControllerMethod(pattern string, c Controller, method string
|
||||
}
|
||||
if _, ok := fval.Interface().(func()); !ok {
|
||||
s := fmt.Sprintf(`invalid medthod definition "%s", while "func()" is required`, fval.Type().String())
|
||||
glog.Warning(s)
|
||||
glog.Error(s)
|
||||
return errors.New(s)
|
||||
}
|
||||
pkgPath := t.Elem().PkgPath()
|
||||
@ -136,7 +136,7 @@ func (s *Server)BindControllerRest(pattern string, c Controller) error {
|
||||
}
|
||||
if _, ok := v.Method(i).Interface().(func()); !ok {
|
||||
s := fmt.Sprintf(`invalid medthod definition "%s", while "func()" is required`, v.Method(i).Type().String())
|
||||
glog.Warning(s)
|
||||
glog.Error(s)
|
||||
return errors.New(s)
|
||||
}
|
||||
pkgName := gfile.Basename(pkgPath)
|
||||
|
||||
@ -53,7 +53,7 @@ func (s *Server)BindObject(pattern string, obj interface{}, methods...string) er
|
||||
if !ok {
|
||||
if methodMap != nil {
|
||||
s := fmt.Sprintf(`invalid medthod definition "%s", while "func(*Request))" is required`, v.Method(i).Type().String())
|
||||
glog.Warning(s)
|
||||
glog.Error(s)
|
||||
return errors.New(s)
|
||||
}
|
||||
continue
|
||||
@ -110,7 +110,7 @@ func (s *Server)BindObjectMethod(pattern string, obj interface{}, method string)
|
||||
faddr, ok := fval.Interface().(func(*Request))
|
||||
if !ok {
|
||||
s := fmt.Sprintf(`invalid medthod definition "%s", while "func(*Request)" is required`, fval.Type().String())
|
||||
glog.Warning(s)
|
||||
glog.Error(s)
|
||||
return errors.New(s)
|
||||
}
|
||||
finit := (func(*Request))(nil)
|
||||
@ -165,7 +165,7 @@ func (s *Server)BindObjectRest(pattern string, obj interface{}) error {
|
||||
faddr, ok := v.Method(i).Interface().(func(*Request))
|
||||
if !ok {
|
||||
s := fmt.Sprintf(`invalid medthod definition "%s", while "func()" is required`, v.Method(i).Type().String())
|
||||
glog.Warning(s)
|
||||
glog.Error(s)
|
||||
return errors.New(s)
|
||||
}
|
||||
pkgName := gfile.Basename(pkgPath)
|
||||
|
||||
Reference in New Issue
Block a user