Qiao-yq commented on issue #3295:
URL: https://github.com/apache/dubbo-go/issues/3295#issuecomment-4318005998

   我尝试写了[component] 前缀使用规范,不知道可不可以
   
   一、必须加前缀的情况
   1. 多实现并存:同一父模块下存在多个并列、可替换的实现
      判定:目录结构中有多个子目录包含同名文件(如 router.go、registry.go)
      前缀格式:[具体实现名] 或 [父模块][具体实现名]
      示例:cluster/router/tag/router.go → [TagRouter]
   
   2. 错误/警告日志:logger.Warn / logger.Error / logger.Errorf 等
      判定:方法名以 Warn 或 Error 开头
      前缀格式:[模块名]
      示例:任何 Error 日志 → [Component] 开头
   
   二、可以不加前缀的情况(需同时满足)
   1. 级别为 Info 或 Debug
   2. 文件名在模块内唯一(无同名文件)
   3. 该文件不属于多实现目录结构
   
   三、前缀格式
   - 驼峰命名:[TagRouter]、[Metadata]、[Registry][Polaris]
   - 紧贴消息,后跟一个空格
   - 最多两层,避免 [A][B][C]


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