From: "NAKAMURA, Hiroshi" Date: 2004-07-16T09:37:15+09:00 Subject: Re: Hiding app.run in begin-rescue block: pros & cons? Hi, Ara.T.Howard wrote: > require 'logger' > logger = Logger.new STDOUT > begin > app.run > rescue Exception => e > logger.debug{ e } > logger.fatal{ 'application failed' } > end > > > print stack trace only when debugging, give users the ability to turn > debugging on with a command line switch. And here's a sample of class Logger::Application which might be usable for original purpose? Regards, // NaHi require 'logger' class App < Logger::Application def initialize(level) super @log.level = Logger.const_get(level.upcase) end def run @log.debug { "debug msg" } @log.info { "info msg" } if @log.fatal? # true iif fatal msg is allowed to dump raise # an exception is logged as a fatal msg end 0 # exit status end end # test puts "<