CAICAIIs commented on code in PR #3320:
URL: https://github.com/apache/dubbo-go/pull/3320#discussion_r3226624343


##########
options.go:
##########
@@ -88,76 +83,21 @@ func (rc *InstanceOptions) init(opts ...InstanceOption) 
error {
                opt(rc)
        }
 
-       // remaining procedure is like RootConfig.Init() without 
RootConfig.Start()
-       // tasks of RootConfig.Start() would be decomposed to Client and Server
-       rcCompat := compatRootConfig(rc)
-
-       if err := rcCompat.Logger.Init(); err != nil { // init default logger
+       if err := rc.initGlobalLogger(); err != nil {
                return err
        }
-       if err := rcCompat.ConfigCenter.Init(rcCompat); err != nil {
-               log.Infof("[Config Center] Config center doesn't start")
-               log.Debugf("config center doesn't start because %s", err)
+       if err := rc.initGlobalConfigCenter(); err != nil {
+               logConfigCenterStartFailure(err)
        } else {
-               compatInstanceOptions(rcCompat, rc)
-               if err = rcCompat.Logger.Init(); err != nil { // init logger 
using config from config center again
-                       return err
-               }
-       }
-
-       if err := rcCompat.Application.Init(); err != nil {
-               return err
-       }
-
-       // init user define
-       if err := rcCompat.Custom.Init(); err != nil {
-               return err
-       }
-
-       // init protocol
-       for _, protocolConfig := range rcCompat.Protocols {
-               if err := protocolConfig.Init(); err != nil {
-                       return err
-               }
-       }
-
-       // init registry
-       registries := rcCompat.Registries
-
-       for _, reg := range registries {
-               if err := reg.Init(); err != nil {
+               if err := rc.initGlobalLogger(); err != nil {
                        return err

Review Comment:
   之前没改好,现在这里已经改成只有 config-center 成功后才重新 init logger。失败路径不会再重复 init



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to