From 56109f941b4680747382f60bc52b241b3d53c3ad Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 21 May 2021 21:04:53 +0300 Subject: [PATCH] [#493] cmd/node: Use new config implementation for logger Signed-off-by: Leonard Lyubich --- cmd/neofs-node/config.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/neofs-node/config.go b/cmd/neofs-node/config.go index 83a2790da..644f6d78c 100644 --- a/cmd/neofs-node/config.go +++ b/cmd/neofs-node/config.go @@ -17,6 +17,8 @@ import ( "github.com/nspcc-dev/neofs-api-go/pkg/netmap" netmapV2 "github.com/nspcc-dev/neofs-api-go/v2/netmap" crypto "github.com/nspcc-dev/neofs-crypto" + "github.com/nspcc-dev/neofs-node/cmd/neofs-node/config" + loggerconfig "github.com/nspcc-dev/neofs-node/cmd/neofs-node/config/logger" "github.com/nspcc-dev/neofs-node/misc" "github.com/nspcc-dev/neofs-node/pkg/core/container" netmapCore "github.com/nspcc-dev/neofs-node/pkg/core/netmap" @@ -305,6 +307,12 @@ const ( ) func initCfg(path string) *cfg { + var p config.Prm + + appCfg := config.New(p, + config.WithConfigFile(path), + ) + viperCfg := initViper(path) key, err := crypto.LoadPrivateKey(viperCfg.GetString(cfgNodeKey)) @@ -329,7 +337,7 @@ func initCfg(path string) *cfg { var logPrm logger.Prm err = logPrm.SetLevelString( - viperCfg.GetString(cfgLogLevel), + loggerconfig.Level(appCfg), ) fatalOnErr(err)