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

incorrect logging formats in setup wizard.

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      In 2.7.1 there are several incorrect logging statements which causes the message to be slightly less than useful.

      $ grep -r -E -n "[^']'{[[:digit:]]"
      hudson/model/UpdateCenter.java:1453:                    LOGGER.log(WARNING, "Update site '{0}' does not declare the connection check URL. "
      jenkins/install/InstallState.java:176:            LOGGER.log(Level.WARNING, "Read install state with blank name: '{0}'. It will be ignored", name);
      jenkins/install/InstallState.java:182:            LOGGER.log(Level.WARNING, "Cannot locate an extension point for the state '{0}'. It will be ignored", name);
      

      The idea here was presumable to put something in single quotes - however a message format requires a quote to be escaped - or it means use whatever is between the quotes without interpretation.

      So you end up with log messages like:

      Jul 18, 2016 1:52:58 PM hudson.model.UpdateCenter$ConnectionCheckJob run
      WARNING: Update site {0} does not declare the connection check URL. Skipping the network availability check.
      

        Attachments

          Issue Links

            Activity

            Hide
            danielbeck Daniel Beck added a comment -

            Oleg Nenashev Is this fixed with your FindBugs fixes?

            Show
            danielbeck Daniel Beck added a comment - Oleg Nenashev Is this fixed with your FindBugs fixes?
            Hide
            oleg_nenashev Oleg Nenashev added a comment -
            Show
            oleg_nenashev Oleg Nenashev added a comment - Daniel Beck Nope. This syntax is "valid" from FindBugs PoV. Likely it's a symbol escaping by quotes: https://github.com/oleg-nenashev/jenkins/blob/e5a728b394f29c69795f2336edf4c4868de3a980/core/src/main/java/hudson/model/UpdateCenter.java#L1453
            Hide
            teilo James Nord added a comment -

            to use a single quote ' in a message format you must use double single quotes ''

            Show
            teilo James Nord added a comment - to use a single quote ' in a message format you must use double single quotes ''
            Hide
            teilo James Nord added a comment -

            Oliver Gondža Does not qualify for LTS as < 2 weeks but the logging was clearly wrong, it is a trivial fix and really helps supporting the product when things go wrong.

            Show
            teilo James Nord added a comment - Oliver Gondža Does not qualify for LTS as < 2 weeks but the logging was clearly wrong, it is a trivial fix and really helps supporting the product when things go wrong.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: James Nord
            Path:
            core/src/main/java/hudson/model/UpdateCenter.java
            core/src/main/java/jenkins/install/InstallState.java
            core/src/main/resources/lib/hudson/project/configurable_pt_BR.properties
            http://jenkins-ci.org/commit/jenkins/943d8203ecfee316ece4c77a8f52f6faef5d6abb
            Log:
            JENKINS-36757 don't quote a paramaterized message in UpdateCenter. (#2494)

            '

            {0}' is the literal string {0}

            in a message format - if you want to quote
            the parameter then you need to use double single quotes ''

            {0}

            ''
            (cherry picked from commit 03750c92ee4ba902027be444144542017c0ccf65)

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: James Nord Path: core/src/main/java/hudson/model/UpdateCenter.java core/src/main/java/jenkins/install/InstallState.java core/src/main/resources/lib/hudson/project/configurable_pt_BR.properties http://jenkins-ci.org/commit/jenkins/943d8203ecfee316ece4c77a8f52f6faef5d6abb Log: JENKINS-36757 don't quote a paramaterized message in UpdateCenter. (#2494) ' {0}' is the literal string {0} in a message format - if you want to quote the parameter then you need to use double single quotes '' {0} '' (cherry picked from commit 03750c92ee4ba902027be444144542017c0ccf65)

              People

              • Assignee:
                teilo James Nord
                Reporter:
                teilo James Nord
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: