Skip to content

Commit 5466f6c

Browse files
Merge pull request #178 from seal-software/master
Removed System.out.println for java.util.logging
2 parents 7603d59 + fb1a9cd commit 5466f6c

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/main/java/com/bettercloud/vault/Vault.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import java.nio.charset.StandardCharsets;
1818
import java.util.HashMap;
1919
import java.util.Map;
20+
import java.util.logging.Logger;
2021

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

5859
private final VaultConfig vaultConfig;
60+
private Logger logger = Logger.getLogger(Vault.class.getCanonicalName());
5961

6062
/**
6163
* Construct a Vault driver instance with the provided config settings.
@@ -67,10 +69,10 @@ public class Vault {
6769
public Vault(final VaultConfig vaultConfig) {
6870
this.vaultConfig = vaultConfig;
6971
if (this.vaultConfig.getNameSpace() != null && !this.vaultConfig.getNameSpace().isEmpty()) {
70-
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()));
72+
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()));
7173
}
7274
if (this.vaultConfig.getSecretsEnginePathMap().isEmpty() && this.vaultConfig.getGlobalEngineVersion() == null) {
73-
System.out.println("Constructing a Vault instance with no provided Engine version, defaulting to version 2.");
75+
logger.info("Constructing a Vault instance with no provided Engine version, defaulting to version 2.");
7476
this.vaultConfig.setEngineVersion(2);
7577
}
7678
}
@@ -89,7 +91,7 @@ public Vault(final VaultConfig vaultConfig, final Integer engineVersion) {
8991
vaultConfig.setEngineVersion(engineVersion);
9092
this.vaultConfig = vaultConfig;
9193
if (this.vaultConfig.getNameSpace() != null && !this.vaultConfig.getNameSpace().isEmpty()) {
92-
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()));
94+
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()));
9395
}
9496
}
9597

@@ -110,12 +112,12 @@ public Vault(final VaultConfig vaultConfig, final Boolean useSecretsEnginePathMa
110112
throws VaultException {
111113
this.vaultConfig = vaultConfig;
112114
if (this.vaultConfig.getNameSpace() != null && !this.vaultConfig.getNameSpace().isEmpty()) {
113-
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()));
115+
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()));
114116
}
115117
this.vaultConfig.setEngineVersion(globalFallbackVersion);
116118
if (useSecretsEnginePathMap && this.vaultConfig.getSecretsEnginePathMap().isEmpty()) {
117119
try {
118-
System.out.println("No secrets Engine version map was supplied, attempting to generate one.");
120+
logger.info("No secrets Engine version map was supplied, attempting to generate one.");
119121
final Map<String, String> secretsEnginePathMap = collectSecretEngineVersions();
120122
assert secretsEnginePathMap != null;
121123
this.vaultConfig.getSecretsEnginePathMap().putAll(secretsEnginePathMap);

src/main/java/module-info.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module vault.java.driver {
2+
requires java.logging;
23
exports com.bettercloud.vault;
34
exports com.bettercloud.vault.api;
45
exports com.bettercloud.vault.json;

0 commit comments

Comments
 (0)