mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
20 lines
336 B
Ruby
Executable file
20 lines
336 B
Ruby
Executable file
require 'rubygems' unless defined?(Gem)
|
|
|
|
class Logger
|
|
def initialize(
|
|
f = '/var/log/vmpooler.log'
|
|
)
|
|
@file = f
|
|
end
|
|
|
|
def log level, string
|
|
time = Time.new
|
|
stamp = time.strftime('%Y-%m-%d %H:%M:%S')
|
|
puts "[#{stamp}] #{string}"
|
|
|
|
open(@file, 'a') do |f|
|
|
f.puts "[#{stamp}] #{string}"
|
|
end
|
|
end
|
|
end
|
|
|