Method: MultiLogger.get_path

Defined in:
lib/multi_logger.rb

.get_path(name, path = nil) ⇒ Object

Computes log file path



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/multi_logger.rb', line 23

def get_path(name, path=nil)
  return path if path == STDOUT
  
  if path.nil?
    path = name.underscore
  end
  if !path.include?('/')
    path = Rails.root.join('log',path).to_s
  end
  if !path.end_with?('.log')
    path += '.log'
  end
  path
end