ChainSafe / ChainSafe/gossamer

chore(logs): add `String() string` methods on complex types logged

Open
#1,945 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
454
Forks
144
PR merge metrics
No merged PRs in 30d

Description

## Issue summary

When reviewing most of the log usage in #1928 I noticed several structures did not have an associated `.String() string` method, which makes the log ugly and bit pointless (e.g. who cares about a pointer address).

The following structures were identified as logged out, complex enough and without a String method:

- `dot.LogConfig`
- `dot.NetworkConfig`
- `dot.Config`
- `dot.RPCConfig`
- `types.GrandpaForcedChange`
- `GrandpaMessage`
- `CommitMessage`
- `VoteMessage`
- `runtime.Context`
- `PublicKey` (mirror `Hex` with `String`)
- ~`babe.Slot`~ done in #1928
- `dot.LogConfig`
- `types.GrandpaScheduledChange`
- `scale.VaryingDataType`
- `types.EpochData`
- `types.GrandpaForcedChange`
- `types.ConfigData`
- `types.Block`
- `types.Header`
- `cfg.Core.Roles`
- `lib/crypto.PublicKey`
- `crypto.Keypair`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.