Module: WolfCore::LoggingUtils

Included in:
ApplicationService, FkmOperations, HttpOperations
Defined in:
lib/wolf_core/utils/logging_utils.rb

Instance Method Summary collapse

Instance Method Details

#log_object(object, title: nil) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/wolf_core/utils/logging_utils.rb', line 3

def log_object(object, title: nil)
  puts '---------------------------------'
  puts title if title
  case object
  when Hash, Array, OpenStruct
    object = object.to_h if object.instance_of?(OpenStruct)
    puts object.to_json
  when Object
    pp object
  else
    puts object
  end
end