> I was under the possibly mistaken impression that with the exception > of our log initialization code, we only relied on the public API for > the Logger class from ruby's stdlib. I've used both Logger.new and > sys log logger without any issues, what did you have to monkeypatch? > That definitely sounds lame.
In general, you're safe relying the public API methods of fatal, error, warn, info, debug and the corresponding level check methods (i.e. fatal?), but I have never seen this formally stated anywhere. In addition, there are public methods in Logger that are not implemented in Logger and vice versa (i.e. BufferedLogger#flush and Logger#<<, Logger#log). Now that I think about it, I haven't had to technically monkey patch logging since Rails 1.2. However, if you want to change the log format using BufferedLogger (since Logger is declared deprecated for Rails in the core_ext/logger.rb code), you need to reimplement the add method which and call undocumented, protected methods from within your code rather than simply setting a formatter as you do with Logger. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
