Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4344

Improve Logging layer implementation to avoid additional boilerplate with if (LOG.isDebugEnable)

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Implemented
    • Affects Version/s: 2.3.16.3
    • Fix Version/s: 2.5
    • Component/s: "New" API
    • Labels:

      Description

      Instead using

      if (LOG.isDebugEnable()) {
           LOG.debug("Action name is [#0]', actionName);
      }
      

      can be reduced to

      LOG.debug("Action name is [#0]', actionName);
      

      with implementation in JdkLogger and any other implementation of Logger interface:

      public void debug(String message, String... params) {
          if(isDebugEnable()) {
               // perform logging
          }
      }
      

        Attachments

          Activity

            People

            • Assignee:
              lukaszlenart Lukasz Lenart
              Reporter:
              lukaszlenart Lukasz Lenart
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: