I've added a logging window to an application, and I would like to display any errors in there too.

So far I have done this:

class NonStderr
  def write( error_string )
    $log_view.insertText(error_string)
  end
end



Then, in applicationDidFinishLaunching(aNotif) I put this:



$stderr = NonStderr.new

$stderr.write "test test test" # appears in my log window

cause_an_exception() # does not appear in the log window



I saw an old ticket about MacRuby not writing errors to stderr,   http://lists.macosforge.org/pipermail/macruby-tickets/2012-February/002686.html   , but this is on the old system so I'm not sure.

Does anyone know how to do this in MacRuby?

Thanks.
-- 
Stephen Horne