jsonapi-rails
jsonapi-rails copied to clipboard
Logs leaking to STDOUT when running specs
How to reproduce
- Clone the repo
-
bundle
-
rake
.I, [2021-11-02T09:37:11.575437 #82869] INFO -- : Completed JSON API rendering (0.64ms)
.I, [2021-11-02T09:37:11.585741 #82869] INFO -- : Completed JSON API rendering (0.33ms)
.I, [2021-11-02T09:37:11.596192 #82869] INFO -- : Completed JSON API rendering (0.42ms)
.I, [2021-11-02T09:37:11.611554 #82869] INFO -- : Completed JSON API rendering (0.36ms)
.I, [2021-11-02T09:37:11.636539 #82869] INFO -- : Completed JSON API rendering (0.56ms)
This also happens when using jsonapi-rails in a rails application
Also discussed here: https://github.com/jsonapi-rb/jsonapi-rails/issues/116
I disabled the logs by adding this to spec/rails_helper.rb
:
ActiveSupport.on_load(:action_controller) do
ActiveSupport::Notifications.unsubscribe('parse.jsonapi-rails')
ActiveSupport::Notifications.unsubscribe('render.jsonapi-rails')
end