Skip to content

Commit a90a6e0

Browse files
authored
fix(levels-logged): Fix log levels logging at start (#2236)
1 parent 08e9703 commit a90a6e0

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

cmd/gossamer/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func createDotConfig(ctx *cli.Context) (*dot.Config, error) {
123123

124124
// TODO: log this better.
125125
// See https://github.com/ChainSafe/gossamer/issues/1945
126-
logger.Infof("loaded package log configuration: %#v", cfg.Log)
126+
logger.Infof("loaded package log configuration: %s", cfg.Log)
127127

128128
// set global configuration values
129129
if err := setDotGlobalConfig(ctx, tomlCfg, &cfg.Global); err != nil {

dot/config.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,21 @@ type LogConfig struct {
6363
FinalityGadgetLvl log.Level
6464
}
6565

66+
func (l LogConfig) String() string {
67+
entries := []string{
68+
fmt.Sprintf("core: %s", l.CoreLvl),
69+
fmt.Sprintf("digest: %s", l.DigestLvl),
70+
fmt.Sprintf("sync: %s", l.SyncLvl),
71+
fmt.Sprintf("network: %s", l.NetworkLvl),
72+
fmt.Sprintf("rpc: %s", l.RPCLvl),
73+
fmt.Sprintf("state: %s", l.StateLvl),
74+
fmt.Sprintf("runtime: %s", l.RuntimeLvl),
75+
fmt.Sprintf("block producer: %s", l.BlockProducerLvl),
76+
fmt.Sprintf("finality gadget: %s", l.FinalityGadgetLvl),
77+
}
78+
return strings.Join(entries, ", ")
79+
}
80+
6681
// InitConfig is the configuration for the node initialization
6782
type InitConfig struct {
6883
Genesis string

0 commit comments

Comments
 (0)