Module: RoRoSupport::Log

Defined in:
lib/roro_support/log.rb

Instance Method Summary collapse

Instance Method Details

#log_put(log_file, log_caller = nil, *contents) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/roro_support/log.rb', line 4

def log_put(log_file, log_caller=nil, *contents)
  log_file ||= "roro.log"
  contents.each do |content|
    if defined?(Rails) && defined?(Rails.root)
      log = Logger.new("#{Rails.root}/log/#{log_file}")
      log.fatal(content)
    end
    log = Logger.new(STDOUT)
    log.fatal(content)
  end

  print log_caller.join("\n") if log_caller && log_caller.is_a?(Array)
end