How to get Rails.logger printing to the console/stdout when running rspec?

前端 未结 5 1550
温柔的废话
温柔的废话 2020-12-04 15:08

Same as title: How to get Rails.logger printing to the console/stdout when running rspec? Eg.

Rails.logger.info \"I WANT this to go to console/s         


        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-04 15:32

    Tail the log as a background job (&) and it will interleave with rspec output.

    tail -f log/test.log &
    bundle exec rspec
    

提交回复
热议问题