7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/r_logger.rb', line 7
def make(log_file)
@logger ||= {}
log_file_name = if log_file.class.in? [String, Symbol]
log_file_name = log_file.to_sym
unless log_file_name.to_s.end_with? ".log"
log_file_name = "#{log_file_name}.log"
end
"#{root_path}/#{log_file_name}"
elsif log_file.respond_to? :to_path
log_file.to_path
else
raise Exceptions::UnsupportdParamType.new("log file parameter only support 'File' or 'String' Type.")
end
@logger[log_file_name] ||= ::Logger.new(log_file_name)
end
|