Get rid of `env.logger` in bin/vagrant

This commit is contained in:
Mitchell Hashimoto 2011-11-30 21:43:57 -08:00
parent 0a47c9d6fa
commit 52f3f8aa67
1 changed files with 11 additions and 3 deletions

View File

@ -1,13 +1,18 @@
#!/usr/bin/env ruby
require 'log4r'
require 'vagrant'
require 'vagrant/cli'
# Create a logger right away
logger = Log4r::Logger.new("vagrant::bin::vagrant")
logger.info("`vagrant` invoked: #{ARGV.inspect}")
# Create the environment, which is the cwd of wherever the
# `vagrant` command was invoked from
logger.debug("Creating Vagrant environment")
env = Vagrant::Environment.new
begin
# Begin logging early here
env.logger.info("vagrant") { "`vagrant` invoked: #{ARGV.inspect}" }
# Disable color if the proper argument was passed
ui = nil
if !$stdout.tty? || ARGV.include?("--no-color")
@ -20,6 +25,9 @@ begin
# the config immediately, so we gather any new commands from
# plugins
env.ui = ui
# Load the environment
logger.debug("Loading environment")
env.load!
# Kick start the CLI