Skip to content

Commit

Permalink
[#1770] node: Validate logger config section
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
  • Loading branch information
carpawell committed Oct 12, 2022
1 parent d7c7022 commit 8c75cb1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cmd/neofs-node/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,26 @@ import (
"github.com/nspcc-dev/neofs-node/cmd/neofs-node/config"
engineconfig "github.com/nspcc-dev/neofs-node/cmd/neofs-node/config/engine"
shardconfig "github.com/nspcc-dev/neofs-node/cmd/neofs-node/config/engine/shard"
loggerconfig "github.com/nspcc-dev/neofs-node/cmd/neofs-node/config/logger"
treeconfig "github.com/nspcc-dev/neofs-node/cmd/neofs-node/config/tree"
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobstor/blobovniczatree"
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobstor/fstree"
"github.com/nspcc-dev/neofs-node/pkg/util/logger"
)

// validateConfig validates storage node configuration.
func validateConfig(c *config.Config) error {
// logger configuration validation

var loggerPrm logger.Prm

err := loggerPrm.SetLevelString(loggerconfig.Level(c))
if err != nil {
return fmt.Errorf("invalid logger level: %w", err)
}

// shard configuration validation

shardNum := 0
paths := make(map[string]pathDescription)
return engineconfig.IterateShards(c, false, func(sc *shardconfig.Config) error {
Expand Down

0 comments on commit 8c75cb1

Please sign in to comment.