Method: Logging.backtrace
- Defined in:
- lib/logging.rb
.backtrace(b = nil) ⇒ Object
call-seq:
Logging.backtrace #=> true or false
Logging.backtrace( value ) #=> true or false
Without any arguments, returns the global exception backtrace logging value. When set to true backtraces will be written to the logs; when set to false backtraces will be suppressed.
When an argument is given the global exception backtrace setting will be changed. Value values are "on", :on<tt> and true to turn on backtraces and <tt>"off", :off and false to turn off backtraces.
307 308 309 310 311 312 313 314 315 316 317 |
# File 'lib/logging.rb', line 307 def backtrace( b = nil ) @backtrace = true unless defined? @backtrace return @backtrace if b.nil? @backtrace = case b when :on, 'on', true; true when :off, 'off', false; false else raise ArgumentError, "backtrace must be true or false" end end |