Skip to content

Comments

Logging improvements#305

Merged
dknopik merged 22 commits intosigp:unstablefrom
dknopik:logging-improvements
May 30, 2025
Merged

Logging improvements#305
dknopik merged 22 commits intosigp:unstablefrom
dknopik:logging-improvements

Conversation

@dknopik
Copy link
Member

@dknopik dknopik commented May 6, 2025

Collection of logging improvements all over the code base.

These changes especially aim to allow debuggability using logfiles sent in by a user, while maintaining a nice overview on the console output without unnecessary detail.

@diegomrsantos
Copy link
Member

I was considering tackling areas of the codebase where we log and return an error, like in

. In cases like this, we should only return an error with the proper message. This error should be kept as the source, in full, if the caller wishes to wrap it with another error for context. In this way, we avoid log duplication. Perhaps, we could do this in this PR.

@dknopik
Copy link
Member Author

dknopik commented May 7, 2025

In cases like this, we should only return an error with the proper message.

Well, ideally we return errors with structured data as long as possible and only turn into a String when we want to output it somewhere. But maybe you mean that.

On the other hand, logging where the error originates gives us more information due to active spans that might not be active where they are caught. 🤔

@diegomrsantos
Copy link
Member

diegomrsantos commented May 7, 2025

In cases like this, we should only return an error with the proper message.

Well, ideally we return errors with structured data as long as possible and only turn into a String when we want to output it somewhere. But maybe you mean that.

On the other hand, logging where the error originates gives us more information due to active spans that might not be active where they are caught. 🤔

We need to capture the backtrace https://docs.rs/anyhow/latest/anyhow/struct.Error.html

@cla-assistant
Copy link

cla-assistant bot commented May 13, 2025

CLA assistant check
All committers have signed the CLA.

@diegomrsantos diegomrsantos requested a review from Copilot May 21, 2025 21:20

This comment was marked as resolved.

@dknopik dknopik marked this pull request as ready for review May 27, 2025 08:19
@dknopik dknopik added the v0.1.0 First Testnet-only release label May 27, 2025
@dknopik dknopik requested a review from diegomrsantos May 30, 2025 09:34
diegomrsantos
diegomrsantos previously approved these changes May 30, 2025
Copy link
Member

@diegomrsantos diegomrsantos left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the work on this

@dknopik dknopik merged commit 11160f6 into sigp:unstable May 30, 2025
12 checks passed
@dknopik dknopik deleted the logging-improvements branch June 20, 2025 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

logging v0.1.0 First Testnet-only release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants