Move VAGRANT_LOG logic into vagrant.rb so VAGRANT_LOG is always available
This commit is contained in:
parent
271d1a92f0
commit
e38e3cc652
|
@ -3,15 +3,6 @@ require 'log4r'
|
||||||
require 'vagrant'
|
require 'vagrant'
|
||||||
require 'vagrant/cli'
|
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
|
# Create a logger right away
|
||||||
logger = Log4r::Logger.new("vagrant::bin::vagrant")
|
logger = Log4r::Logger.new("vagrant::bin::vagrant")
|
||||||
logger.info("`vagrant` invoked: #{ARGV.inspect}")
|
logger.info("`vagrant` invoked: #{ARGV.inspect}")
|
||||||
|
|
|
@ -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 'pathname'
|
||||||
require 'json'
|
require 'json'
|
||||||
require 'i18n'
|
require 'i18n'
|
||||||
|
|
Loading…
Reference in New Issue