Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(levels-logged): Fix log levels logging at start #2236

Merged
merged 1 commit into from
Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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