5
5
import java .util .LinkedHashMap ;
6
6
import java .util .List ;
7
7
import java .util .Map ;
8
+ import org .slf4j .Logger ;
9
+ import org .slf4j .LoggerFactory ;
8
10
9
11
@ SuppressForbidden
10
12
public class ConfigHelper {
@@ -13,6 +15,8 @@ public class ConfigHelper {
13
15
// Default to production source
14
16
private static SupportedConfigurationSource configSource = new SupportedConfigurationSource ();
15
17
18
+ private static final Logger log = LoggerFactory .getLogger (ConfigHelper .class );
19
+
16
20
public static void setConfigInversionStrict (ConfigInversionStrictStyle configInversionStrict ) {
17
21
ConfigHelper .configInversionStrict = configInversionStrict ;
18
22
}
@@ -56,7 +60,6 @@ public static Map<String, String> getEnvironmentVariables() {
56
60
}
57
61
}
58
62
}
59
-
60
63
// TODO: Follow-up - Add deprecation handling
61
64
// if (configSource.getDeprecatedConfigurations().containsKey(key)) {
62
65
// String warning = "Environment variable " + key + " is deprecated. " +
@@ -77,10 +80,13 @@ public static String getEnvironmentVariable(String name) {
77
80
&& !configSource .getAliasMapping ().containsKey (name )
78
81
&& !configSource .getSupportedConfigurations ().contains (name )) {
79
82
if (configInversionStrict != ConfigInversionStrictStyle .TEST ) {
80
- System .err .println (
81
- "Warning: Missing environment variable "
82
- + name
83
- + " from supported-configurations.json." );
83
+ // TODO: Replace this log with Telemetry
84
+ // System.err.println(
85
+ // "Warning: Missing environment variable "
86
+ // + name
87
+ // + " from supported-configurations.json.");
88
+ log .error (
89
+ "Warning: Missing environment variable {} from supported-configurations.json." , name );
84
90
}
85
91
86
92
if (configInversionStrict == ConfigInversionStrictStyle .STRICT ) {
0 commit comments