Class: AbAdmin::Utils::Logger::ExtendedLogger

Inherits:
Logger
  • Object
show all
Defined in:
lib/ab_admin/utils/logger.rb

Instance Method Summary collapse

Instance Method Details

#exception(e, options = {}) ⇒ Object


5
6
7
8
9
# File 'lib/ab_admin/utils/logger.rb', line 5

def exception(e, options={})
  message = "#{e.message} #{"DATA:#{options[:data].inspect}" if options && options[:data]}"
  backtrace = e.backtrace.map { |l| "#{' ' * 2}#{l}" }.join("\n")
  error("#{e.class} #{message}\n#{backtrace}\n\n")
end

#reopenObject


11
12
13
# File 'lib/ab_admin/utils/logger.rb', line 11

def reopen
  @logdev = LogDevice.new(@logdev.filename)
end