Introduce deprecation categories (#68061)

Sort-of backport of #67443.

Closes #64824. Introduce the concept of categories to deprecation
logging. Every location where we log a deprecation message must now
include a deprecation category.
This commit is contained in:
Rory Hunter 2021-01-29 14:31:13 +00:00 committed by GitHub
parent 6c8ed22e95
commit 1c5b89c89d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
172 changed files with 612 additions and 313 deletions

View file

@ -26,6 +26,7 @@ import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.auth.BasicSessionCredentials;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.common.logging.DeprecationCategory;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.settings.SecureSetting;
import org.elasticsearch.common.settings.SecureString;
@ -135,12 +136,12 @@ final class Ec2ClientSettings {
return null;
} else {
if (key.length() == 0) {
deprecationLogger.deprecate("ec2_invalid_settings",
deprecationLogger.deprecate(DeprecationCategory.SETTINGS, "ec2_invalid_settings",
"Setting [{}] is set but [{}] is not, which will be unsupported in future",
SECRET_KEY_SETTING.getKey(), ACCESS_KEY_SETTING.getKey());
}
if (secret.length() == 0) {
deprecationLogger.deprecate("ec2_invalid_settings",
deprecationLogger.deprecate(DeprecationCategory.SETTINGS, "ec2_invalid_settings",
"Setting [{}] is set but [{}] is not, which will be unsupported in future",
ACCESS_KEY_SETTING.getKey(), SECRET_KEY_SETTING.getKey());
}