[#493] logger: Simplify Logger's parameters

Replace `viper.Viper` parameter with `Prm` structure. Currently only logging
level can be parameterized through string setter.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-05-11 11:54:59 +03:00 committed by Alex Vanin
parent 2a970b0125
commit db2e43387b
4 changed files with 43 additions and 25 deletions

View file

@ -352,7 +352,14 @@ func initCfg(path string) *cfg {
viperCfg.GetString(cfgReputationContract))
fatalOnErr(err)
log, err := logger.NewLogger(viperCfg)
var logPrm logger.Prm
err = logPrm.SetLevelString(
viperCfg.GetString(cfgLogLevel),
)
fatalOnErr(err)
log, err := logger.NewLogger(logPrm)
fatalOnErr(err)
log = log.With(