notaryproject / notation-go

A collection of libraries for supporting sign and verify OCI artifacts. Based on Notary Project specifications.
Apache License 2.0
39 stars 42 forks source link

error message performance needs to be improved #480

Open JeyJeyGao opened 4 days ago

JeyJeyGao commented 4 days ago

What is not working as expected?

logger.Errorf("Certificate #%d in chain with subject %v encountered an error for revocation method %s at URL %q: %v", (i + 1), cert.Subject.String(), serverResult.RevocationMethod, serverResult.Server, serverResult.Error)

Code like this example should be optimized to avoid rendering the string before actually logging it.

logger.Errorf("Certificate #%d in chain with subject %v encountered an error for revocation method %s at URL %q: %v", (i + 1), cert.Subject, serverResult.RevocationMethod, serverResult.Server, serverResult.Error)

What did you expect to happen?

nil

How can we reproduce it?

nil

Describe your environment

source code

What is the version of your notation-go Library?

v1.3.0-rc.1