How do I get maximal logging while fixtures load? Or at least during the
tests?
I have added this to test/test_helper.rb :-
def logger
RAILS_DEFAULT_LOGGER.level = Logger::INFO
RAILS_DEFAULT_LOGGER
end
so that I can use logger.info("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
RAILS_DEFAULT_LOGGER.level = Logger::INFO
RAILS_DEFAULT_LOGGER.debug("studen_test.test_truth")
assert trueo
end
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,
Hugh
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
On Jul 17, 12:51 pm, Hugh Sasse <h...-C9usXPTk/FFaa/9Udqfwiw@public.gmane.org> 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 .... end and comment out the start and end lines of the block. That should do the trick. Rebecca --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Thu, 19 Jul 2007, Rebecca Blyth wrote:> 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 > .... > 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, Hugh --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---