Class: Vagrant::Logger

Inherits:
Logger
  • Object
show all
Defined in:
lib/vagrant/util.rb

Constant Summary collapse

@@singleton_logger =
nil

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.reset_logger!Object



41
42
43
# File 'lib/vagrant/util.rb', line 41

def reset_logger!
  @@singleton_logger = nil
end

.singleton_loggerObject



32
33
34
35
36
37
38
39
# File 'lib/vagrant/util.rb', line 32

def singleton_logger
  # TODO: Buffer messages until config is loaded, then output them?
  if Vagrant.config.loaded?
    @@singleton_logger ||= Vagrant::Logger.new(Vagrant.config.vagrant.log_output)
  else
    Vagrant::Logger.new(nil)
  end
end

Instance Method Details

#format_message(level, time, progname, msg) ⇒ Object



46
47
48
# File 'lib/vagrant/util.rb', line 46

def format_message(level, time, progname, msg)
  "[#{level} #{time.strftime('%m-%d-%Y %X')}] Vagrant: #{msg}\n"
end