File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
stubbornjava-common/src/main/java/com/stubbornjava/common Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,11 @@ public static Config properties() {
30
30
return properties ;
31
31
}
32
32
33
+ // This should return the current executing user path
34
+ public static String getExecutionDirectory () {
35
+ return system .getString ("user.dir" );
36
+ }
37
+
33
38
public static Map <String , Object > asMap (Config config ) {
34
39
return Seq .seq (config .entrySet ())
35
40
.toMap (e -> e .getKey (), e -> e .getValue ().unwrapped ());
@@ -66,14 +71,16 @@ public Builder envAwareApp() {
66
71
}
67
72
68
73
public Builder withSecureConf () {
69
- return withOptionalFile (". /secure.conf" );
74
+ return withOptionalFile (getExecutionDirectory () + " /secure.conf" );
70
75
}
71
76
72
77
public Config build () {
73
78
// Resolve substitutions.
74
79
conf = conf .resolve ();
75
- log .debug ("Logging properties. Make sure sensitive data such as passwords or secrets are not logged!" );
76
- log .debug (conf .root ().render (ConfigRenderOptions .concise ().setFormatted (true )));
80
+ if (log .isDebugEnabled ()) {
81
+ log .debug ("Logging properties. Make sure sensitive data such as passwords or secrets are not logged!" );
82
+ log .debug (conf .root ().render (ConfigRenderOptions .concise ().setFormatted (true )));
83
+ }
77
84
return conf ;
78
85
}
79
86
You can’t perform that action at this time.
0 commit comments