Skip to content

refactor(logging): inline MustGetLogger's panic instead of utils.MustGet - #1854

Merged
mbrandenburger merged 1 commit into
hyperledger-labs:mainfrom
mbrandenburger:logging-must-get-inline-panic
Sep 16, 2026
Merged

mbrandenburger merged 1 commit into
hyperledger-labs:mainfrom
mbrandenburger:logging-must-get-inline-panic

Conversation

@mbrandenburger

Copy link
Copy Markdown
Member

Summary

  • MustGetLogger routed through the generic utils.MustGet helper to turn GetLogger's error into a panic. Inlines that check directly so the panic follows the regexp.MustCompile convention on its own terms, without depending on the generic helper.
  • Adds Godoc to MustGetLogger, GetLogger, and GetPackageName explaining why GetLogger can only fail on a static invariant (the caller's stack frame can't be resolved) rather than runtime input, which is why panicking on it here is appropriate.
  • Adds TestMustGetLogger as a regression test for the inlined panic/return path.

Test plan

  • go test ./platform/common/services/logging/...
  • make checks

@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Hey @mbrandenburger 👋 thanks for the PR!
I'm your friendly PR Helper Bot 🤖 and I'll be riding shotgun on this one, keeping track of your PR's status to help you get it approved and merged.

This comment updates automatically as you push changes -- think of it as your PR's live scoreboard!
Here's the latest:


PR Checks

✅ DCO Sign-off -- All commits have valid sign-offs. Nice work!


❌ GPG Signature -- Heads up! The following commits don't have a verified GPG signature:

  • 2de3284 refactor(logging): inline MustGetLogger's panic instead of utils.MustGet

You'll need to sign your commits with GPG (e.g. git commit -S). See the Signing Guide for a step-by-step walkthrough.


✅ Merge Conflicts -- No merge conflicts detected. Smooth sailing!


❌ Issue Link -- This PR is not linked to any issue.

Please reference an issue using a closing keyword (e.g. Fixes #123) and ensure the issue is assigned to you. Every PR needs a home!


⏳ All checks must pass before this PR can be reviewed. You've got this!

@github-actions github-actions Bot added the status: needs revision The pull request requires changes from the author before it can be reviewed or merged label Sep 16, 2026
@mbrandenburger mbrandenburger added this to the 26Q3 milestone Sep 16, 2026
@SaidAltury-ibm
SaidAltury-ibm self-requested a review September 16, 2026 08:33

@SaidAltury-ibm SaidAltury-ibm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

MustGetLogger routed through the generic utils.MustGet helper to turn
GetLogger's error into a panic. Inline the check directly so the panic
follows the regexp.MustCompile convention on its own terms, and document
why GetLogger can only fail on a static invariant rather than runtime
input.

Signed-off-by: Marcus Brandenburger <bur@zurich.ibm.com>
@SaidAltury-ibm
SaidAltury-ibm force-pushed the logging-must-get-inline-panic branch from 9bf1f52 to 2de3284 Compare September 16, 2026 09:02
@mergify

mergify Bot commented Sep 16, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@mbrandenburger
mbrandenburger merged commit cc8f0b5 into hyperledger-labs:main Sep 16, 2026
45 checks passed
@mbrandenburger
mbrandenburger deleted the logging-must-get-inline-panic branch September 16, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: needs revision The pull request requires changes from the author before it can be reviewed or merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants