Module: LoggerExceptionFormat
- Defined in:
- lib/logger_exception_format.rb
Constant Summary collapse
- Version =
"0.0.2"
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
3 4 5 |
# File 'lib/logger_exception_format.rb', line 3 def self.included(base) base.alias_method_chain :debug, :exception_format end |
Instance Method Details
#debug_with_exception_format(message = nil, programe = nil, &block) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/logger_exception_format.rb', line 7 def debug_with_exception_format(=nil, programe=nil, &block) return unless debug? if .is_a? Exception debug_without_exception_format do lines = ["[#{message.class}] #{message.message}"] lines << .backtrace.map{|t| " #{t}" } lines.join("\n") end else debug_without_exception_format(, programe, &block) end end |