• <legend id='bxddv'><style id='bxddv'><dir id='bxddv'><q id='bxddv'></q></dir></style></legend>

    <i id='bxddv'><tr id='bxddv'><dt id='bxddv'><q id='bxddv'><span id='bxddv'><b id='bxddv'><form id='bxddv'><ins id='bxddv'></ins><ul id='bxddv'></ul><sub id='bxddv'></sub></form><legend id='bxddv'></legend><bdo id='bxddv'><pre id='bxddv'><center id='bxddv'></center></pre></bdo></b><th id='bxddv'></th></span></q></dt></tr></i><div id='bxddv'><tfoot id='bxddv'></tfoot><dl id='bxddv'><fieldset id='bxddv'></fieldset></dl></div>
    <tfoot id='bxddv'></tfoot>

  • <small id='bxddv'></small><noframes id='bxddv'>

      <bdo id='bxddv'></bdo><ul id='bxddv'></ul>

      1. Slf4j LoggerFactory.getLogger 和 sonarqube

        Slf4j LoggerFactory.getLogger and sonarqube(Slf4j LoggerFactory.getLogger 和 sonarqube)

              <legend id='cp1AF'><style id='cp1AF'><dir id='cp1AF'><q id='cp1AF'></q></dir></style></legend>
                • <bdo id='cp1AF'></bdo><ul id='cp1AF'></ul>
                • <i id='cp1AF'><tr id='cp1AF'><dt id='cp1AF'><q id='cp1AF'><span id='cp1AF'><b id='cp1AF'><form id='cp1AF'><ins id='cp1AF'></ins><ul id='cp1AF'></ul><sub id='cp1AF'></sub></form><legend id='cp1AF'></legend><bdo id='cp1AF'><pre id='cp1AF'><center id='cp1AF'></center></pre></bdo></b><th id='cp1AF'></th></span></q></dt></tr></i><div id='cp1AF'><tfoot id='cp1AF'></tfoot><dl id='cp1AF'><fieldset id='cp1AF'></fieldset></dl></div>
                  <tfoot id='cp1AF'></tfoot>

                  <small id='cp1AF'></small><noframes id='cp1AF'>

                    <tbody id='cp1AF'></tbody>
                  本文介绍了Slf4j LoggerFactory.getLogger 和 sonarqube的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  初始化Slf4j LoggerFactory.getLogger的正确方法是什么?我的代码中有

                  What is the correct way to initialize Slf4j LoggerFactory.getLogger? I have in my code

                  static final Logger logger = LoggerFactory.getLogger(MyClass.class);
                  

                  但 sonarqube 代码分析将此代码标记为重大错误:"重命名此常量名称以匹配正则表达式'^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'"

                  But sonarqube code analysis marks this code as major error: "Rename this constant name to match the regular expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'"

                  怎么了?

                  推荐答案

                  常量(静态final)变量在Java中一般都是大写的.所以你可以:

                  Constants (static final) variables are generally in upper case in Java. So you can either:

                  • 在这种特殊情况下忽略注释(在记录器中使用小型大写字母并不罕见)
                  • logger 重命名为其他名称,例如 LOG
                  • ignore the comment in this particular case (it is not unusual to use small caps for the logger)
                  • rename logger into something else, for example LOG

                  这篇关于Slf4j LoggerFactory.getLogger 和 sonarqube的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Security - Array is stored directly(安全性 - 数组直接存储)
                  SonarQube quot;Class Not Foundquot; during Main AST Scan(SonarQube“找不到类在主 AST 扫描期间)
                  Integrate Spock#39;s test with Sonar(将 Spock 的测试与声纳集成)
                  How do I make Hudson/Jenkins fail if Sonar thresholds are breached?(如果违反声纳阈值,我如何让 Hudson/Jenkins 失败?)
                  automatically add curly brackets to all if/else/for/while etc. in a java code-base(自动将大括号添加到 java 代码库中的所有 if/else/for/while 等)
                  How do I ignore duplicated code report in Sonar?(如何忽略 Sonar 中的重复代码报告?)
                  • <bdo id='cEyEH'></bdo><ul id='cEyEH'></ul>
                    1. <tfoot id='cEyEH'></tfoot>

                            <tbody id='cEyEH'></tbody>

                          <small id='cEyEH'></small><noframes id='cEyEH'>

                          • <i id='cEyEH'><tr id='cEyEH'><dt id='cEyEH'><q id='cEyEH'><span id='cEyEH'><b id='cEyEH'><form id='cEyEH'><ins id='cEyEH'></ins><ul id='cEyEH'></ul><sub id='cEyEH'></sub></form><legend id='cEyEH'></legend><bdo id='cEyEH'><pre id='cEyEH'><center id='cEyEH'></center></pre></bdo></b><th id='cEyEH'></th></span></q></dt></tr></i><div id='cEyEH'><tfoot id='cEyEH'></tfoot><dl id='cEyEH'><fieldset id='cEyEH'></fieldset></dl></div>

                          • <legend id='cEyEH'><style id='cEyEH'><dir id='cEyEH'><q id='cEyEH'></q></dir></style></legend>