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

          [JENKINS-34298] Use the logging API and replace debug messages

          Implemented in 48d5fe0b

          Christian McHugh added a comment - Implemented in 48d5fe0b

          As of 48d5fe0b you must now use jenkins logging:

          Name: salt logs
          Logger: com.waytta.saltstack
          Log level: ALL (currently only logs to FINE, but this could always change)

          Christian McHugh added a comment - As of 48d5fe0b you must now use jenkins logging: Name: salt logs Logger: com.waytta.saltstack Log level: ALL (currently only logs to FINE, but this could always change)

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

              Created:
              Updated:
              Resolved: