Skip to content

Commit 9470b15

Browse files
committed
adding deprecation handling
1 parent 5bd67a4 commit 9470b15

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

utils/config-utils/src/main/java/datadog/trace/config/inversion/ConfigHelper.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,17 @@ public static Map<String, String> getEnvironmentVariables() {
5555
}
5656
}
5757
}
58-
5958
// TODO: Follow-up - Add deprecation handling
60-
// if (configSource.getDeprecatedConfigurations().containsKey(key)) {
61-
// String warning = "Environment variable " + key + " is deprecated. " +
62-
// (configSource.getAliasMapping().containsKey(key)
63-
// ? "Please use " + configSource.getAliasMapping().get(key) + " instead."
64-
// : configSource.getDeprecatedConfigurations().get(key));
65-
// System.err.println(warning);
66-
// }
59+
if (configSource.getDeprecatedConfigurations().containsKey(key)) {
60+
String warning =
61+
"Environment variable "
62+
+ key
63+
+ " is deprecated. "
64+
+ (configSource.getAliasMapping().containsKey(key)
65+
? "Please use " + configSource.getAliasMapping().get(key) + " instead."
66+
: configSource.getDeprecatedConfigurations().get(key));
67+
System.err.println(warning);
68+
}
6769
} else {
6870
configs.put(key, value);
6971
}

0 commit comments

Comments
 (0)