13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/utility/environment.rb', line 13
def self.set_execution_environment(config, &block)
ENV['TZ'] = 'UTC'
Logger.level = config[:log_level]
es_config = config[:elasticsearch]
disable_warnings = if es_config.has_key?(:disable_warnings)
es_config[:disable_warnings]
else
true
end
if disable_warnings
Logger.info('Disabling warnings')
Kernel.silence_warnings(&block)
else
Logger.info('Enabling warnings')
Kernel.enable_warnings(&block)
end
end
|