63isOK opened a new issue #1427:
URL: https://github.com/apache/dubbo-go/issues/1427


   <!-- Please only use this template for submitting enhancement requests -->
   
   **What would you like to be added**:
   
   1. 日志初始化不要放在init. 是否可以考虑放在初始化函数中.
   2. 在纯client场景,是否可以考虑不需要处理server配置.
   
   > "unmarshalYmlConfig error ioutil.ReadFile(file:../profiles/dev/server.yml) 
= error:open ../profiles/dev/server.yml: no such file or directory"
   
   **Why is this needed**:
   
   1. 
在自定义配置路径的场景,且通过os.Setenv来设置环境变量的场景下,必须在dubbogo包导入之前的init()中设置环境变量,否在会有warn.
   
   ```go
   func init() {
        // forbidden to executing twice.
        if logger != nil {
                return
        }
   
        fs := flag.NewFlagSet("log", flag.ContinueOnError)
        logConfFile := fs.String("logConf", 
os.Getenv(constant.APP_LOG_CONF_FILE), "default log config path")
        fs.Parse(os.Args[1:])
        for len(fs.Args()) != 0 {
                fs.Parse(fs.Args()[1:])
        }
        if *logConfFile == "" {
                *logConfFile = constant.DEFAULT_LOG_CONF_FILE_PATH
        }
        err := InitLog(*logConfFile)
        if err != nil {
                logger.Warnf("InitLog with error %v", err)
        }
   }
   ```
   
   2. 去掉无意义的warn.


-- 
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