Skip to content

Commit

Permalink
Updates callsites synthax for i18n.t method to avoid deprecated and p…
Browse files Browse the repository at this point in the history
…rohibited format (#15500)

Updates invocations of i18n.t method which are leftovers and missed in the original Ruby 3.1 update PR #14861

Without this, some error reporting logs are hidden by the mismatch of arguments error in translate the error message.
  • Loading branch information
andsel authored Oct 25, 2023
1 parent 16da966 commit 90964fb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion logstash-core/lib/logstash/java_pipeline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def inputworker(plugin)
# otherwise, report error and restart
@logger.error(I18n.t(
"logstash.pipeline.worker-error-debug",
default_logging_keys(
**default_logging_keys(
:plugin => plugin.inspect,
:error => e.message,
:exception => e.class,
Expand Down
2 changes: 1 addition & 1 deletion logstash-core/lib/logstash/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def execute

field_reference_escape_style_setting = settings.get_setting('config.field_reference.escape_style')
if field_reference_escape_style_setting.set?
logger.warn(I18n.t("logstash.settings.technical_preview.set", canonical_name: field_reference_escape_style_setting.name))
logger.warn(I18n.t("logstash.settings.technical_preview.set", :canonical_name => field_reference_escape_style_setting.name))
end
field_reference_escape_style = field_reference_escape_style_setting.value
logger.debug("Setting global FieldReference escape style: #{field_reference_escape_style}")
Expand Down
12 changes: 6 additions & 6 deletions logstash-core/lib/logstash/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -840,15 +840,15 @@ def initialize(canonical_proxy, alias_name)

def set(value)
deprecation_logger.deprecated(I18n.t("logstash.settings.deprecation.set",
deprecated_alias: name,
canonical_name: canonical_proxy.name))
:deprecated_alias => name,
:canonical_name => canonical_proxy.name))
super
end

def value
logger.warn(I18n.t("logstash.settings.deprecation.queried",
deprecated_alias: name,
canonical_name: canonical_proxy.name))
:deprecated_alias => name,
:canonical_name => canonical_proxy.name))
@canonical_proxy.value
end

Expand Down Expand Up @@ -914,8 +914,8 @@ def format(output)
def validate_value
if deprecated_alias.set? && canonical_setting.set?
fail(ArgumentError, I18n.t("logstash.settings.deprecation.ambiguous",
canonical_name: canonical_setting.name,
deprecated_alias: deprecated_alias.name))
:canonical_name => canonical_setting.name,
:deprecated_alias => deprecated_alias.name))
end

super
Expand Down

0 comments on commit 90964fb

Please sign in to comment.