Add bit more logging to WekanConfig

This commit is contained in:
Malanius 2018-09-30 17:54:51 +02:00
parent b1f005dd19
commit 4546d9099c
2 changed files with 8 additions and 1 deletions

View file

@ -19,9 +19,10 @@ public class Application implements CommandLineRunner {
@Override
public void run(String... args) {
public void run(String... args) {
try {
WekanConfiguration wekanConfiguration = new WekanConfiguration();
} catch (BrmException ex) {
System.exit(ex.getExitCode().getCode());
}

View file

@ -33,6 +33,8 @@ public class WekanConfiguration {
* @throws BrmException if some of the properties is missing in ENV variables.
*/
public WekanConfiguration() throws BrmException {
LOG.trace("{}() - start.", this.getClass().getSimpleName());
for (String prop : properties) {
checkProp(prop);
}
@ -41,6 +43,8 @@ public class WekanConfiguration {
this.wekanPassword = System.getenv(WEKAN_PASSWORD);
this.wekanBoard = System.getenv(WEKAN_TARGET_BOARD);
this.wekanList = System.getenv(WEKAN_TARGET_LIST);
LOG.info("Wekan config loaded successfully.");
}
@Getter
@ -59,6 +63,8 @@ public class WekanConfiguration {
private String wekanList;
private void checkProp(String prop) throws BrmException {
LOG.trace("checkProp({}) - start.", prop);
if (System.getenv(prop) == null) {
String message = ExitCode.CONFIGURATION_MISSING.getReason() + prop;
LOG.error(message, ExitCode.CONFIGURATION_MISSING);