Forum: Ruby on Rails Turning logging on while fixtures load?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
457cf540784a12ba2f30e06565a2c189?d=identicon&s=25 Hugh Sasse (Guest)
on 2007-07-17 13:52
(Received via mailing list)
How do I get maximal logging while fixtures load?  Or at least during

I have added this to test/test_helper.rb :-

  def logger

so that I can use"message") in my tests, This didn't
work, and neither did

  # Replace this with your real tests.
  # <FIXME>Leave this till other tests work</FIXME>
  def test_truth
    assert trueo

I still get nothing logged when this runs.  I'm trying to debug my
fixtures which are setup with fixture_references, but I can't even
get logging to work here.  I'm looking for entries in the log directory
where the {developer,test,server,production}.log files are, but nothing
ends up in those, even though they exist.

`       Thank you,
5f361e572e14b68654093429d55f80b3?d=identicon&s=25 Rebecca Blyth (Guest)
on 2007-07-19 16:29
(Received via mailing list)
On Jul 17, 12:51 pm, Hugh Sasse <> wrote:
> How do I get maximal logging whilefixturesload?  Or at least during the
> tests?

Rails turns off logging while the fixtures are loading. To get output
in the logs, you have to do a little hack of rails.

Firstly, it's probably best to do this in a frozen version of rails,
then you only affect your own app.

The edit needs to be done in vendor/rails/activerecord/lib/
active_record/fixtures.rb in the method self.create_fixtures(...).
Find the bit where it says
ActiveRecord::Base.silence do
and comment out the start and end lines of the block.

That should do the trick.

457cf540784a12ba2f30e06565a2c189?d=identicon&s=25 Hugh Sasse (Guest)
on 2007-07-20 10:45
(Received via mailing list)
On Thu, 19 Jul 2007, Rebecca Blyth wrote:

>   ....
> end
> and comment out the start and end lines of the block.

Thank you.  I would never have found that without help.
> That should do the trick.
> Rebecca
        Thank you,
This topic is locked and can not be replied to.