[#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

@ -44,7 +44,14 @@ func main() {
cfg, err := newConfig(*configFile)
exitErr(err)
log, err := logger.NewLogger(cfg)
var logPrm logger.Prm
err = logPrm.SetLevelString(
cfg.GetString("logger.level"),
)
exitErr(err)
log, err := logger.NewLogger(logPrm)
exitErr(err)
log = log.With(