mercredi 22 novembre 2017

How to make tail -f log/test.log readable

I'm a big fan of feature tests with Rails. To help with debugging what would really be awesome is if I could look at the test logs in a readable way without everything being compressed into one massive line.

For example I get about 50 lines of this if a test fails:

Could not log "render_template.action_view" event. NoMethodError: undefined method `example_group' for nil:NilClass ["/Users/***/.rvm/gems/ruby-2.3.0/gems/rspec-rails-3.6.0/lib/rspec/rails/view_rendering.rb:67:in `current_example_group'", "/Users/***/.rvm/gems/ruby-2.3.0/gems/rspec-rails-3.6.0/lib/rspec/rails/view_rendering.rb:71:in `render_template'", "/Users/***/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.3/lib/active_support/subscriber.rb:95:in `finish'", "/Users/***/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.3/lib/active_support/log_subscriber.rb:83:in `finish'", "/Users/***/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.3/lib/active_support/notifications/fanout.rb:102:in `finish'", "/Users/***/.rvm/gems

Is it possible? I've tried out gems like better_logging, pretty print etc but no luck.

Aucun commentaire:

Enregistrer un commentaire