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 "<<DEBUG"
p App.new("DEBUG").start
puts "DEBUG"

puts

puts "<<INFO"
p App.new("INFO").start
puts "INFO"

puts

puts "<<UNKNOWN"
p App.new("UNKNOWN").start
puts "UNKNOWN"