Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-19605

Add a CI job to check for non-i18n INFO/WARN/ERROR logging

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Minor Minor
    • 34.0.0.Final
    • None
    • Test Suite
    • None

      Check PRs for stray logging statements that should either be internationalized or converted to a lower log level.

      This would basically be a bit of automated code review.

      Grep the PR diff:

      1) For lines starting with + but not ++ (i.e. ignore diff lines showing the name of changed or added files)
      2) Ignore src/test/ or testsuite/
      3) Look for ".info(", ".infof(", ".warn(", ".warnf(", ".error(", ".errorf(", ".fatal(", ".fatalf(", "System.out.print", "System.err.print", ".printStackTrace".
      4) Ignore cases where "//" precedes the items in 3)

      Fail if found.

      I don't think being super helpful in the failure message is particularly important. A static failure message that generally explains what the test is looking for should suffice; if it fails people can figure out the problem easily enough by looking at the diff.

      A script executed by a github action seems like a good way to do this as once it's done it can be applied to many code bases.

              rchakrab Ranabir Chakraborty
              bstansbe@redhat.com Brian Stansberry
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: