Yeah, as I told, i don't know the insides of the error method or the correct specification.. Just wanted to give a hint how you could do it to get it to work quickly and without much trouble.
And in my opinion its not that dirty to alias a function if you know what you do. Sure you can use a block to do the mailing. Am Sonntag, 13. Januar 2013 13:00:50 UTC+1 schrieb Jordon Bedwell: > > On Sun, Jan 13, 2013 at 5:42 AM, Crispin Schäffler > <[email protected] <javascript:>> wrote: > > I don't really know that much about the interns of Rails.logger.error > method > > but how about overwriting it for your app? > > > > use alias on the old method and do something like this: > > alias :old_error :error > > > > def error > > # send your mail or whatever > > old_error > > end > > > > would at least do its job without braking all the stuff the logger does. > > Uhm, you guys do know that you do not have to resort to such dirty > tactics? Read: > > Rails.logger.error do > "There was an error".tap do |s| > # Do mailing Work Here > end > end > > cat log/development.log > There was an error > -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/K29Qcs73qk0J. For more options, visit https://groups.google.com/groups/opt_out.

