From 52f3f8aa67f2be25ddcd59507ee82f9e51bf8784 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 30 Nov 2011 21:43:57 -0800 Subject: [PATCH] Get rid of `env.logger` in bin/vagrant --- bin/vagrant | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bin/vagrant b/bin/vagrant index 668b5fedc..3ad27732f 100755 --- a/bin/vagrant +++ b/bin/vagrant @@ -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