Uploaded image for project: 'Maven Enforcer Plugin'
  1. Maven Enforcer Plugin
  2. MENFORCER-488

EnforcerLogger: Provide isDebugEnabled(), isErrorEnabled(), isWarnEnabled() and isInfoEnabled()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.4.0
    • Rule API
    • None

    Description

      Similar to what SLF4J Logger (https://www.slf4j.org/api/org/slf4j/Logger.html) and org.apache.maven.plugin.logging.Log provide, there should be a method to determine if a certain log level is enabled. This is useful to put a guard around costly evaluation methods which are only ever useful once a certain level is active.

      As switching log level is mostly done via -X command line a isDebugEnabled should be sufficient though for most of the cases.

      Using the supplier parameter does not always help e.g. when multiple debug outputs should be surrounded by the same guard.

      Attachments

        Issue Links

          Activity

            People

              kwin Konrad Windszus
              kwin Konrad Windszus
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: