From 028cad99c9cf3a47df83f8f5a69c6c3b2126721f Mon Sep 17 00:00:00 2001 From: Matthew Hutchinson Date: Thu, 22 Jun 2023 10:10:56 +0100 Subject: [PATCH] fix deprecation warning from Rails 7.2, use kwarg for bold option Why? Fixes DEPRECATION WARNING: Bolding log text with a positional boolean is deprecated and will be removed in Rails 7.2. Use an option hash instead (eg. `color("my text", :red, bold: true)`) --- .../lib/elasticsearch/rails/instrumentation/log_subscriber.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elasticsearch-rails/lib/elasticsearch/rails/instrumentation/log_subscriber.rb b/elasticsearch-rails/lib/elasticsearch/rails/instrumentation/log_subscriber.rb index c388961c..ba31727f 100644 --- a/elasticsearch-rails/lib/elasticsearch/rails/instrumentation/log_subscriber.rb +++ b/elasticsearch-rails/lib/elasticsearch/rails/instrumentation/log_subscriber.rb @@ -47,7 +47,7 @@ def search(event) name = "#{payload[:klass]} #{payload[:name]} (#{event.duration.round(1)}ms)" search = payload[:search].inspect.gsub(/:(\w+)=>/, '\1: ') - debug %Q| #{color(name, GREEN, true)} #{colorize_logging ? "\e[2m#{search}\e[0m" : search}| + debug %Q| #{color(name, GREEN, bold: true)} #{colorize_logging ? "\e[2m#{search}\e[0m" : search}| end end