Skip to content

Commit

Permalink
Merge pull request #178 from seal-software/master
Browse files Browse the repository at this point in the history
Removed System.out.println for java.util.logging
  • Loading branch information
steve-perkins authored Jun 26, 2019
2 parents 7603d59 + fb1a9cd commit 5466f6c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main/java/com/bettercloud/vault/Vault.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;

/**
* <p>The Vault driver class, the primary interface through which dependent applications will access Vault.</p>
Expand Down Expand Up @@ -56,6 +57,7 @@
public class Vault {

private final VaultConfig vaultConfig;
private Logger logger = Logger.getLogger(Vault.class.getCanonicalName());

/**
* Construct a Vault driver instance with the provided config settings.
Expand All @@ -67,10 +69,10 @@ public class Vault {
public Vault(final VaultConfig vaultConfig) {
this.vaultConfig = vaultConfig;
if (this.vaultConfig.getNameSpace() != null && !this.vaultConfig.getNameSpace().isEmpty()) {
System.out.println(String.format("The NameSpace %s has been bound to this Vault instance. Please keep this in mind when running operations.", this.vaultConfig.getNameSpace()));
logger.info(String.format("The NameSpace %s has been bound to this Vault instance. Please keep this in mind when running operations.", this.vaultConfig.getNameSpace()));
}
if (this.vaultConfig.getSecretsEnginePathMap().isEmpty() && this.vaultConfig.getGlobalEngineVersion() == null) {
System.out.println("Constructing a Vault instance with no provided Engine version, defaulting to version 2.");
logger.info("Constructing a Vault instance with no provided Engine version, defaulting to version 2.");
this.vaultConfig.setEngineVersion(2);
}
}
Expand All @@ -89,7 +91,7 @@ public Vault(final VaultConfig vaultConfig, final Integer engineVersion) {
vaultConfig.setEngineVersion(engineVersion);
this.vaultConfig = vaultConfig;
if (this.vaultConfig.getNameSpace() != null && !this.vaultConfig.getNameSpace().isEmpty()) {
System.out.println(String.format("The Namespace %s has been bound to this Vault instance. Please keep this in mind when running operations.", this.vaultConfig.getNameSpace()));
logger.info(String.format("The Namespace %s has been bound to this Vault instance. Please keep this in mind when running operations.", this.vaultConfig.getNameSpace()));
}
}

Expand All @@ -110,12 +112,12 @@ public Vault(final VaultConfig vaultConfig, final Boolean useSecretsEnginePathMa
throws VaultException {
this.vaultConfig = vaultConfig;
if (this.vaultConfig.getNameSpace() != null && !this.vaultConfig.getNameSpace().isEmpty()) {
System.out.println(String.format("The Namespace %s has been bound to this Vault instance. Please keep this in mind when running operations.", this.vaultConfig.getNameSpace()));
logger.info(String.format("The Namespace %s has been bound to this Vault instance. Please keep this in mind when running operations.", this.vaultConfig.getNameSpace()));
}
this.vaultConfig.setEngineVersion(globalFallbackVersion);
if (useSecretsEnginePathMap && this.vaultConfig.getSecretsEnginePathMap().isEmpty()) {
try {
System.out.println("No secrets Engine version map was supplied, attempting to generate one.");
logger.info("No secrets Engine version map was supplied, attempting to generate one.");
final Map<String, String> secretsEnginePathMap = collectSecretEngineVersions();
assert secretsEnginePathMap != null;
this.vaultConfig.getSecretsEnginePathMap().putAll(secretsEnginePathMap);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module vault.java.driver {
requires java.logging;
exports com.bettercloud.vault;
exports com.bettercloud.vault.api;
exports com.bettercloud.vault.json;
Expand Down

0 comments on commit 5466f6c

Please sign in to comment.