lib/openstudio/analysis/server_api.rb in openstudio-analysis-1.0.0.rc10 vs lib/openstudio/analysis/server_api.rb in openstudio-analysis-1.0.0.rc11

- old
+ new

@@ -7,12 +7,16 @@ # Define set of anlaysis methods require batch_run to be queued after them BATCH_RUN_METHODS = %w(lhs preflight single_run repeat_run doe diag baseline_perturbation batch_datapoints).freeze def initialize(options = {}) - defaults = { hostname: 'http://localhost:8080' } + defaults = { hostname: 'http://localhost:8080', log_path: File.expand_path('~/os_server_api.log') } options = defaults.merge(options) - @logger = ::Logger.new('faraday.log') + if ENV['OS_SERVER_LOG_PATH'] + @logger = ::Logger.new(ENV['OS_SERVER_LOG_PATH'] + '/os_server_api.log') + else + @logger = ::Logger.new(options[:log_path]) + end @hostname = options[:hostname] raise 'no host defined for server api class' if @hostname.nil?