You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using ActiveSupport::LogSubscriber#color inside a custom log subscriber
causes NoMethodError.
```ruby
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
gem "activesupport"
end
require "active_support"
class TestLogSubscriber < ActiveSupport::LogSubscriber
attach_to :test
def hi(event)
info(color(event.payload[:message], GREEN))
end
private
def log_exception(name, e)
super
raise e
end
end
ActiveSupport::LogSubscriber.logger = ActiveSupport::Logger.new(STDOUT)
ActiveSupport::Notifications.instrument("hi.test", message: "Hello!")
```
```
/rails/activesupport/lib/active_support/log_subscriber.rb:193:in `mode_from': undefined method `compact_blank' for an instance of Hash (NoMethodError)
modes = MODES.values_at(*options.compact_blank.keys)
^^^^^^^^^^^^^^
```
For what it's worth, I have encountered this while using kredis locally, like;
```
$ cd kredis
$ bin/console
irb(main):001> Kredis.string "mystring"
Could not log "meta.kredis" event. NoMethodError: undefined method `compact_blank' for an instance of Hash
```
0 commit comments