Skip to content

Commit

Permalink
[config] refs fibercrypto#298 - Add default configuration for log level
Browse files Browse the repository at this point in the history
  • Loading branch information
AntiD2ta committed Jan 4, 2020
1 parent f03d126 commit 0364ad1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/coin/skycoin/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const (
LocalWallet = "local"
RemoteWallet = "remote"
SectionName = "skycoin"
SettingPathToLog = "log"
SettingPathToNode = "node"
SettingPathToWalletSource = "walletSource"
)
Expand Down Expand Up @@ -52,7 +53,14 @@ func RegisterConfig() error {

wltOpt := local.NewOption(string(wltSrc.id), []string{SettingPathToWalletSource}, false, string(wltSrcBytes))

sectionManager = cm.RegisterSection(SectionName, []*local.Option{nodeOpt, wltOpt})
level := map[string]string{"level": "Debug"}
levelBytes, err := json.Marshal(level)
if err != nil {
return err
}
logLevelOpt := local.NewOption(SettingPathToLog, []string{}, false, string(levelBytes))

sectionManager = cm.RegisterSection(SectionName, []*local.Option{nodeOpt, wltOpt, logLevelOpt})
return nil
}

Expand Down

0 comments on commit 0364ad1

Please sign in to comment.