add deprecated field warning

This commit is contained in:
William Banfield
2022-03-29 20:34:20 -04:00
parent e9fdca779c
commit 285bcb0995
2 changed files with 55 additions and 1 deletions

View File

@@ -51,10 +51,12 @@ func RootCommand(conf *config.Config, logger log.Logger) *cobra.Command {
}
*conf = *pconf
config.EnsureRoot(conf.RootDir)
if err := log.OverrideWithNewLogger(logger, conf.LogFormat, conf.LogLevel); err != nil {
return err
}
if warning := pconf.DeprecatedFieldWarning(); warning != nil {
logger.Info("WARNING", "deprecated field warning", warning)
}
return nil
},