17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/toolshed.rb', line 17
def add_file_log_source(command_name = '')
log_path = Toolshed.configuration.log_path
return if log_path.nil? || log_path.empty?
FileUtils.mkdir_p(log_path)
command_name_string = '_'
command_name_string = "_#{command_name}_" unless command_name.nil? || command_name.empty? file_name = "toolshed#{command_name_string}#{Time.now.utc.strftime('%Y%m%d%H%M%S%L')}" file = "#{log_path}/#{file_name}"
FileUtils.touch(file)
logger.add_log_source(file)
end
|