Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-34298

Use the logging API and replace debug messages

XMLWordPrintable

      The debug messages in the plug-in are quite useful. But as we add more, the code will become bloated, and then we may want to distinguish different debug messages (like per level), and then we would be re-writing a logging API, which already exists and is available for Jenkins plug-ins.

      We could simply add a logger as follows in the builder:

          private static final Logger LOGGER = Logger.getLogger("com.waytta.saltstack");
      

      Which is using the Java Util Logging API (https://docs.oracle.com/javase/8/docs/api/java/util/logging/package-summary.html). This way we can log debug, info, warnings, etc, and users are able to manage the logging level and what they see through Jenkins web interface (https://wiki.jenkins-ci.org/display/JENKINS/Logging).

            mchugh19 Christian McHugh
            kinow Bruno P. Kinoshita
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: