(maint) Emit console messages when debugging is enabled

Previously all log messages may be written to a text file, however during
development or debugging it is also useful if the log messages are written to
the console.  This commit changes the logger class to emit messages to the
console, via `puts`, if the VMPOOLER_DEBUG environment variable is set.
This commit is contained in:
Glenn Sarti 2017-03-31 16:53:24 -07:00
parent d4a50e5e56
commit e04f380f42

View file

@ -12,6 +12,8 @@ module Vmpooler
time = Time.new
stamp = time.strftime('%Y-%m-%d %H:%M:%S')
puts "[#{stamp}] #{string}" if ENV['VMPOOLER_DEBUG']
open(@file, 'a') do |f|
f.puts "[#{stamp}] #{string}"
end