Module: AmazingPrint::Logger

Defined in:
lib/amazing_print/core_ext/logger.rb

Instance Method Summary collapse

Instance Method Details

#ap(object, options = {}) ⇒ Object

Add ap method to logger




12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/amazing_print/core_ext/logger.rb', line 12

def ap(object, options = {})
  if options.is_a?(Hash)
    level = options.delete(:level)
  else
    level = options
    options = {}
  end

  level ||= AmazingPrint.defaults[:log_level] if AmazingPrint.defaults
  level ||= :debug
  send level, object.ai(options)
end