Move VAGRANT_LOG logic into vagrant.rb so VAGRANT_LOG is always available

This commit is contained in:
Mitchell Hashimoto 2011-12-03 17:12:07 -08:00
parent 271d1a92f0
commit e38e3cc652
2 changed files with 11 additions and 9 deletions

View File

@ -3,15 +3,6 @@ require 'log4r'
require 'vagrant'
require 'vagrant/cli'
# Enable logging if it is requested. We do this before
# anything else so that all logs are visible.
if ENV["VAGRANT_LOG"]
logger = Log4r::Logger.new("vagrant")
logger.outputters = Log4r::Outputter.stdout
logger.level = Log4r.const_get(ENV["VAGRANT_LOG"].upcase)
logger = nil
end
# Create a logger right away
logger = Log4r::Logger.new("vagrant::bin::vagrant")
logger.info("`vagrant` invoked: #{ARGV.inspect}")

View File

@ -1,3 +1,14 @@
# Enable logging if it is requested. We do this before
# anything else so that we can setup the output before
# any logging occurs.
if ENV["VAGRANT_LOG"]
require 'log4r'
logger = Log4r::Logger.new("vagrant")
logger.outputters = Log4r::Outputter.stdout
logger.level = Log4r.const_get(ENV["VAGRANT_LOG"].upcase)
logger = nil
end
require 'pathname'
require 'json'
require 'i18n'