lib/wolf_core/utils/logging_utils.rb



require_relative 'result'

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