Skip to content

Comments

feat: add panic hook for logging#674

Merged
mergify[bot] merged 1 commit intosigp:release-v1.0.0from
dknopik:add-panic-hook
Oct 10, 2025
Merged

feat: add panic hook for logging#674
mergify[bot] merged 1 commit intosigp:release-v1.0.0from
dknopik:add-panic-hook

Conversation

@dknopik
Copy link
Member

@dknopik dknopik commented Oct 9, 2025

Issue Addressed

When going through LH's and Anchor's startup procedures, I noticed that Anchor does not have a panic hook, causing panics to only be printed on stderr, but not in logs. This is bad in cases where the user only retains logs, but not stderr.

Proposed Changes

Steal panic hook code from LH, logging the panic properly.

@dknopik dknopik requested a review from petarjuki7 October 9, 2025 09:28
@dknopik dknopik added ready-for-review This PR is ready to be reviewed logging v1.0.0 First Mainnet-release labels Oct 9, 2025
@dknopik dknopik requested a review from jking-aus October 9, 2025 12:53
Copy link
Member

@jking-aus jking-aus left a comment

Choose a reason for hiding this comment

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

lgtm!

@jking-aus jking-aus added ready-for-merge and removed ready-for-review This PR is ready to be reviewed labels Oct 10, 2025
@mergify mergify bot added the queued label Oct 10, 2025
mergify bot added a commit that referenced this pull request Oct 10, 2025
@mergify mergify bot merged commit 5b3a505 into sigp:release-v1.0.0 Oct 10, 2025
17 checks passed
@mergify mergify bot removed the queued label Oct 10, 2025
petarjuki7 pushed a commit to petarjuki7/anchor that referenced this pull request Oct 16, 2025
When going through LH's and Anchor's startup procedures, I noticed that Anchor does not have a panic hook, causing panics to only be printed on stderr, but not in logs. This is bad in cases where the user only retains logs, but not stderr.


  Steal panic hook code from LH, logging the panic properly.


Co-Authored-By: Daniel Knopik <daniel@dknopik.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants