So in rails 2.1 the standard method for overriding log file format has
changed? no longer can i
class Logger
  def format_message(severity, timestamp, progname, msg)
    "#{timestamp} #{severity} #{msg}\n"
  end
end
instead from this site
http://wiki.rubyonrails.org/rails/pages/HowtoConfigureLogging
i am recommended to use...
class Logger
  def format_message(severity, timestamp, progname, msg)
    if <a
href="mailto:!@formatter.nil">!@formatter.nil</a>?
      @formatter.call(severity, timestamp, progname, msg)
    else
      @default_formatter.call(severity, timestamp, progname, msg)
    end
  end
end
class RailsFormatter < Logger::Formatter
  def call(severity, timestamp, progname, msg)
    "#{msg}\n"
  end
end
RAILS_DEFAULT_LOGGER.formatter = RailsFormatter.new
but that just throws up a syntax error on the if statement and then
the last line.
All i really need is time stamps in rails 2.1, and there seems to be
some conflict about the best method to do that, any suggestions?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---