Module: OxyLogger::Helper

Defined in:
lib/oxy_logger.rb

Instance Method Summary collapse

Instance Method Details

#log_after(method_name, *args) ⇒ Object



32
# File 'lib/oxy_logger.rb', line 32

def log_after(method_name, *args); end

#log_befor(method_name, *args) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/oxy_logger.rb', line 15

def log_befor(method_name, *args)
  first_data = {}
  type = self.class.superclass.to_s
  first_data[:start] = DateTime.now
  first_data[:name] = method_name
  first_data[:class_name] = self.class.name
    if type == "ApplicationRecord"
    first_data[:type] = :model
    else
    first_data[:type] = :controller
    end
  first_data[:params] = first_data[:type] == :model ?
  first_data[:args] = args :
  first_data[:args] = params
  Writer.write(first_data)
end