mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
(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:
parent
d4a50e5e56
commit
e04f380f42
1 changed files with 2 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue