XnLemon opened a new pull request, #3345:
URL: https://github.com/apache/dubbo-go/pull/3345

   ### Description
   Fixes #3339
   
     在 logger 初始化阶段,dubbo-go 自身的 
loggerfacade(`dubbo.apache.org/dubbo-go/v3/logger`)从未被同步设置。初始化代码只调用了 
`github.com/dubbogo/gost/log/logger.SetLogger()` 和 `getty.SetLogger()`,导致 
facade 内部的全局变量始终为 `nil` 
     用户调用 `dubboLogger.SetLoggerLevel()` 时,facade 对 nil 做类型断言,静默返回  false 
,日志级别调整完全不生效。
   
     **修复内容:**
   
     - `fix(logger): sync dubbo-go logger facade in LoggerConfig.Init()`
       修复 `config/logger_config.go` 的 `Init()` 方法,在设置 gost logger 和 getty 
的同时,同步设置 dubbo-go
     facade。同时为两个 logger 包的 import 添加明确的 alias(`gostLogger` / 
`dubboLogger`)避免包名歧义。
   
     - `fix(logger): sync dubbo-go logger facade in config_loader init()`
       修复 `config/config_loader.go` 的 `init()` 函数,程序启动时的默认 zap logger 同步设置到 
dubbo-go
     facade。
   
     - `fix(logger): sync dubbo-go logger facade in initGlobalLogger()`
       修复 `instance_options_init.go` 的 `initGlobalLogger()` 
方法,`dubbo.NewInstance()` 初始化路径下同步设置
      dubbo-go facade。
   
     - `test(logger): verify dubbo-go facade is synced after logger 
initialization`
       新增测试覆盖:zap driver、logrus driver、zap + trace-integration 三条路径,验证 facade 
初始化后不为
     nil,且 `SetLoggerLevel` 在 zap driver 下能正确生效(包括开启 trace-integration 时通过 
`ZapCtxLogger`
     wrapper 的透传)。
   
     **Btw:**
     第一次提pr,辛苦reviewer了owo
   
   
    ### Checklist
    - [x] I confirm the target branch is `develop`
    - [x] Code has passed local testing
    - [x] I have added tests that prove my fix is effective or that my feature 
works


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