-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Change setting's deprecation message wording #120718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 17 commits
b882a19
f547955
78155a0
b4c25e7
a4c86c7
7042d74
7be8f49
010ab17
283c86a
9d5d6ab
80e5116
80ecb3c
2977e43
16b77ae
b0ad071
65d7696
f0271f9
af21543
223c5cb
bbbbfe5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,6 @@ | |
| import org.elasticsearch.core.TimeValue; | ||
| import org.elasticsearch.core.Tuple; | ||
| import org.elasticsearch.core.UpdateForV10; | ||
| import org.elasticsearch.core.UpdateForV9; | ||
| import org.elasticsearch.index.mapper.DateFieldMapper; | ||
| import org.elasticsearch.xcontent.ToXContentObject; | ||
| import org.elasticsearch.xcontent.XContentBuilder; | ||
|
|
@@ -83,6 +82,11 @@ | |
| * </pre> | ||
| */ | ||
| public class Setting<T> implements ToXContentObject { | ||
| private static final String DEPRECATED_MESSAGE_TEMPLATE = | ||
| "[{}] setting was deprecated in Elasticsearch and will be removed in a future release. " | ||
| + "See the %s changes documentation for the next major version."; | ||
| private static final String DEPRECATED_WARN_MESSAGE = String.format(Locale.ROOT, DEPRECATED_MESSAGE_TEMPLATE, "deprecation"); | ||
|
||
| private static final String DEPRECATED_CRITICAL_MESSAGE = String.format(Locale.ROOT, DEPRECATED_MESSAGE_TEMPLATE, "breaking"); | ||
|
|
||
| public enum Property { | ||
| /** | ||
|
|
@@ -651,10 +655,8 @@ void checkDeprecation(Settings settings) { | |
| if (this.isDeprecated() && this.exists(settings)) { | ||
| // It would be convenient to show its replacement key, but replacement is often not so simple | ||
| final String key = getKey(); | ||
| @UpdateForV9(owner = UpdateForV9.Owner.CORE_INFRA) // https://github.com/elastic/elasticsearch/issues/79666 | ||
| String message = "[{}] setting was deprecated in Elasticsearch and will be removed in a future release."; | ||
| if (this.isDeprecatedWarningOnly()) { | ||
| Settings.DeprecationLoggerHolder.deprecationLogger.warn(DeprecationCategory.SETTINGS, key, message, key); | ||
| Settings.DeprecationLoggerHolder.deprecationLogger.warn(DeprecationCategory.SETTINGS, key, DEPRECATED_WARN_MESSAGE, key); | ||
| } else if (this.isDeprecatedAndRemoved()) { | ||
| Settings.DeprecationLoggerHolder.deprecationLogger.critical( | ||
| DeprecationCategory.SETTINGS, | ||
|
|
@@ -663,7 +665,12 @@ void checkDeprecation(Settings settings) { | |
| key | ||
| ); | ||
| } else { | ||
| Settings.DeprecationLoggerHolder.deprecationLogger.critical(DeprecationCategory.SETTINGS, key, message, key); | ||
| Settings.DeprecationLoggerHolder.deprecationLogger.critical( | ||
| DeprecationCategory.SETTINGS, | ||
| key, | ||
| DEPRECATED_CRITICAL_MESSAGE, | ||
| key | ||
| ); | ||
| } | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use
Strings.format(either class)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done