修复rpcx 日志异常问题

This commit is contained in:
liwei1dao 2022-08-09 11:02:04 +08:00
parent fb419359d0
commit 45bb5eadfc

View File

@ -118,10 +118,8 @@ func newOptionsByOption(opts ...Option) (options *Options, err error) {
if len(options.ServiceTag) == 0 || len(options.ServiceType) == 0 || len(options.ServiceId) == 0 || len(options.ConsulServers) == 0 {
return options, errors.New("[Sys.RPCX] newOptions err: 启动参数异常")
}
if options.Debug && options.Log == nil {
if options.Log = log.NewTurnlog(options.Debug, log.Clone("sys.rpc", 2)); options.Log == nil {
err = errors.New("log is nil")
}
if options.Log = log.NewTurnlog(options.Debug, log.Clone("sys.rpc", 2)); options.Log == nil {
err = errors.New("log is nil")
}
return options, nil
}