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() {
3030 return properties ;
3131 }
3232
33+ // This should return the current executing user path
34+ public static String getExecutionDirectory () {
35+ return system .getString ("user.dir" );
36+ }
37+
3338 public static Map <String , Object > asMap (Config config ) {
3439 return Seq .seq (config .entrySet ())
3540 .toMap (e -> e .getKey (), e -> e .getValue ().unwrapped ());
@@ -66,14 +71,16 @@ public Builder envAwareApp() {
6671 }
6772
6873 public Builder withSecureConf () {
69- return withOptionalFile (". /secure.conf" );
74+ return withOptionalFile (getExecutionDirectory () + " /secure.conf" );
7075 }
7176
7277 public Config build () {
7378 // Resolve substitutions.
7479 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+ }
7784 return conf ;
7885 }
7986
You can’t perform that action at this time.
0 commit comments