jsonapi-rails icon indicating copy to clipboard operation
jsonapi-rails copied to clipboard

Logs leaking to STDOUT when running specs

Open tagliala opened this issue 2 years ago • 1 comments

How to reproduce

  1. Clone the repo
  2. bundle
  3. 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

tagliala avatar Nov 02 '21 08:11 tagliala

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

ndbroadbent avatar Jun 28 '22 04:06 ndbroadbent