I tried to extend it , with this class , loaded at config time :
config.autoload_paths += Dir["#{config.root}/lib",
"#{config.root}/lib/**/", "#{config.root}/app/inputs"]

lib/extension.rb
class ActiveSupport::BufferedLogger
def detailed_error(e)
error(e.message)
e.backtrace.each{|line| error line }
end
end

but calling it in my controller

rescue ActiveRecord::RecordInvalid
logger.detailed_error($!)

raises an error => undefined method `detailed_error' for
#<Logger:0x007fb8ecaabcc8>
what's wrong with my class definition ?

thanks for feedback

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/4gnQaitFTv4J.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedOct 25, '12 at 10:08a
activeOct 25, '12 at 10:08a
posts1
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Erwin: 1 post

People

Translate

site design / logo © 2021 Grokbase