Uploaded image for project: 'OpenShift Windows Containers'
  1. OpenShift Windows Containers
  2. WINC-721

Fix improper usage of the logr

XMLWordPrintable

    • 2
    • False
    • False

      Description

      This is a tech debt story to fix our usage of the logger in our controller code. In a few places (like here and here) we incorrectly use the logr.WithValues method. We should setting our logger to the value returned by the function call, instead of ignoring the return value. This will properly propagate our desired values into the log output.

      Engineering Details

      Logr docs:
      // With logr's structured logging, we'd write:
      // // elsewhere in the file, set up the logger to log with the prefix of
      // // "reconcilers", and the named value target-type=Foo, for extra context.
      // log := mainLogger.WithName("reconcilers").WithValues("target-type", "Foo")
       

      Acceptance Criteria

      • logging calls in the Reconcilers properly includes the given values (watch object's name and namespace)
      • removal of redundant information in log calls

            Unassigned Unassigned
            mohashai Mohammad Shaikh
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: