Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logging message performance needs to be improved #480

Closed
JeyJeyGao opened this issue Nov 21, 2024 · 0 comments · Fixed by #481
Closed

logging message performance needs to be improved #480

JeyJeyGao opened this issue Nov 21, 2024 · 0 comments · Fixed by #481
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@JeyJeyGao
Copy link
Contributor

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

@JeyJeyGao JeyJeyGao added bug Something isn't working triage Needs evaluation for feasibility, timeline, etc. enhancement New feature or request and removed bug Something isn't working labels Nov 21, 2024
@yizha1 yizha1 removed the triage Needs evaluation for feasibility, timeline, etc. label Nov 26, 2024
@yizha1 yizha1 added this to the 1.3.0 milestone Nov 26, 2024
@JeyJeyGao JeyJeyGao changed the title error message performance needs to be improved logging message performance needs to be improved Nov 29, 2024
JeyJeyGao added a commit to JeyJeyGao/notation-go that referenced this issue Dec 9, 2024
Fix:
- replaced `.String()` with the `%v` format to avoid rendering the
string before actually logging it.

Resolves notaryproject#480

Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
JeyJeyGao added a commit to JeyJeyGao/notation-go that referenced this issue Dec 9, 2024
commit ecd22a2
Author: Junjie Gao <junjiegao@microsoft.com>
Date:   Tue Dec 3 06:19:18 2024 +0000

    fix: update comment

    Signed-off-by: Junjie Gao <junjiegao@microsoft.com>

commit 32ae375
Author: Junjie Gao <junjiegao@microsoft.com>
Date:   Mon Dec 2 09:10:37 2024 +0000

    fix: update

    Signed-off-by: Junjie Gao <junjiegao@microsoft.com>

commit 0076d0f
Author: Junjie Gao <junjiegao@microsoft.com>
Date:   Mon Dec 2 03:13:08 2024 +0000

    fix: update LimitedWriter

    Signed-off-by: Junjie Gao <junjiegao@microsoft.com>

commit 067d4f6
Author: Junjie Gao <junjiegao@microsoft.com>
Date:   Mon Dec 2 02:32:17 2024 +0000

    fix(test): update

    Signed-off-by: Junjie Gao <junjiegao@microsoft.com>

commit 3099d35
Author: Junjie Gao <junjiegao@microsoft.com>
Date:   Mon Dec 2 10:03:54 2024 +0800

    perf(log): encode objects only when logged (notaryproject#481)

    Fix:
    - replaced `.String()` with the `%v` format to avoid rendering the
    string before actually logging it.

    Resolves notaryproject#480

    Signed-off-by: Junjie Gao <junjiegao@microsoft.com>

commit 8bc331b
Author: Patrick Zheng <patrickzheng@microsoft.com>
Date:   Mon Dec 2 08:30:56 2024 +0800

    fix: enable timestamping cert chain revocation check during signing (notaryproject#482)

    Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
    Signed-off-by: Junjie Gao <junjiegao@microsoft.com>

commit 161a736
Author: Junjie Gao <junjiegao@microsoft.com>
Date:   Mon Dec 2 02:13:35 2024 +0000

    fix: resolve comments for Shiwei

    Signed-off-by: Junjie Gao <junjiegao@microsoft.com>

commit 665e111
Author: Junjie Gao <junjiegao@microsoft.com>
Date:   Fri Nov 29 08:07:16 2024 +0000

    fix: update code style

    Signed-off-by: Junjie Gao <junjiegao@microsoft.com>

commit 5d6c89e
Author: Junjie Gao <junjiegao@microsoft.com>
Date:   Fri Nov 29 08:06:15 2024 +0000

    fix: update comments

    Signed-off-by: Junjie Gao <junjiegao@microsoft.com>

commit 3bc343d
Author: Junjie Gao <junjiegao@microsoft.com>
Date:   Fri Nov 29 07:42:38 2024 +0000

    fix: update comment

    Signed-off-by: Junjie Gao <junjiegao@microsoft.com>

commit 69303b5
Author: Junjie Gao <junjiegao@microsoft.com>
Date:   Fri Nov 29 07:40:15 2024 +0000

    fix: limit the plugin output size

    Signed-off-by: Junjie Gao <junjiegao@microsoft.com>

Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Two-Hearts pushed a commit to Two-Hearts/notation-go that referenced this issue Dec 9, 2024
Fix:
- replaced `.String()` with the `%v` format to avoid rendering the
string before actually logging it.

Resolves notaryproject#480

Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Two-Hearts pushed a commit to Two-Hearts/notation-go that referenced this issue Dec 9, 2024
Fix:
- replaced `.String()` with the `%v` format to avoid rendering the
string before actually logging it.

Resolves notaryproject#480

Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Two-Hearts pushed a commit to Two-Hearts/notation-go that referenced this issue Dec 9, 2024
Fix:
- replaced `.String()` with the `%v` format to avoid rendering the
string before actually logging it.

Resolves notaryproject#480

Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants