NethermindEth / near-sffl

https://nffl.nethermind.io/
MIT License
6 stars 3 forks source link

Standardize error logging #179

Closed Hyodar closed 1 month ago

Hyodar commented 1 month ago

Sometimes we are logging errors using a separate tag, like:

logger.Error("Something happened!", "err", err)

And sometimes we are using a format string, e.g.:

logger.Errorf("Something happened: %w", err)

I'd say the tag one seems better (my vote), and that's what we've been trying to follow, but either way we need to chose one standard and refactor the usages. Should be quick, just some manual work.

emlautarom1 commented 1 month ago

I prefer the tag one. Manually formatting strings is error prone (ex. why use %w here?)