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

Use the logging API and replace debug messages

    Details

    • Similar Issues:

      Description

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

        Attachments

          Activity

          Hide
          mchugh19 Christian McHugh added a comment -

          Implemented in 48d5fe0b

          Show
          mchugh19 Christian McHugh added a comment - Implemented in 48d5fe0b
          Hide
          mchugh19 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)

          Show
          mchugh19 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)

            People

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

              Dates

              • Created:
                Updated:
                Resolved: