Add logging configuration. Add --dump option to just print the full configuration.

This commit is contained in:
Anatoly Sablin
2020-01-25 14:57:22 +03:00
parent 73526be2ac
commit 9219bd4723
5 changed files with 97 additions and 23 deletions

View File

@@ -76,4 +76,14 @@ public class YamlConfigLoader {
}
}
public static void dumpConfig(MxisdConfig cfg) {
Representer rep = new Representer();
rep.getPropertyUtils().setBeanAccess(BeanAccess.FIELD);
rep.getPropertyUtils().setAllowReadOnlyProperties(true);
rep.getPropertyUtils().setSkipMissingProperties(true);
Yaml yaml = new Yaml(new Constructor(MxisdConfig.class), rep);
String dump = yaml.dump(cfg);
log.info("Full configuration:\n{}", dump);
}
}