Skip to content

Commit

Permalink
fix(levels-logged): Fix log levels logging at start (#2236)
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 authored Jan 27, 2022
1 parent 08e9703 commit a90a6e0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/gossamer/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func createDotConfig(ctx *cli.Context) (*dot.Config, error) {

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

// set global configuration values
if err := setDotGlobalConfig(ctx, tomlCfg, &cfg.Global); err != nil {
Expand Down
15 changes: 15 additions & 0 deletions dot/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,21 @@ type LogConfig struct {
FinalityGadgetLvl log.Level
}

func (l LogConfig) String() string {
entries := []string{
fmt.Sprintf("core: %s", l.CoreLvl),
fmt.Sprintf("digest: %s", l.DigestLvl),
fmt.Sprintf("sync: %s", l.SyncLvl),
fmt.Sprintf("network: %s", l.NetworkLvl),
fmt.Sprintf("rpc: %s", l.RPCLvl),
fmt.Sprintf("state: %s", l.StateLvl),
fmt.Sprintf("runtime: %s", l.RuntimeLvl),
fmt.Sprintf("block producer: %s", l.BlockProducerLvl),
fmt.Sprintf("finality gadget: %s", l.FinalityGadgetLvl),
}
return strings.Join(entries, ", ")
}

// InitConfig is the configuration for the node initialization
type InitConfig struct {
Genesis string
Expand Down

0 comments on commit a90a6e0

Please sign in to comment.