Uploaded image for project: 'Apache YuniKorn'
  1. Apache YuniKorn
  2. YUNIKORN-1578

Use zap.Stringer instead of calling String on object

    XMLWordPrintableJSON

Details

    Description

      Throughout the code we have lots of places where we use the following call structure:

      zap.String("text here", object.String()) 

      This causes the object.String() call to happen before we even consider if it needs to be logged. Zap has a lazy way of doing this that removes the call to create the stringĀ  until it is needed, after the level checks etc. The above call becomes:

      zap.Stringer("text here", object) 

      Affect core and k8shim

      Attachments

        Activity

          People

            zhuqi Qi Zhu
            wilfreds Wilfred Spiegelenburg
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: