Method: Cnvrg::Logger#log_method

Defined in:
lib/cnvrg/logger.rb

#log_method(bind: nil) ⇒ Object



65
66
67
68
69
70
71
72
73
74
# File 'lib/cnvrg/logger.rb', line 65

def log_method(bind: nil)
  return if bind.blank?
  Cnvrg::Logger.log_handler if $log.blank?
  arg = {}
  bind.local_variables.map do |name|
    arg[name] = bind.local_variable_get(name).try(:to_s)
  end
  method = bind.eval('__method__')
  $log.info method: method, args: arg
end