diff --git a/bin/vagrant b/bin/vagrant index d78b9825a..707a2a12a 100755 --- a/bin/vagrant +++ b/bin/vagrant @@ -6,7 +6,7 @@ env = Vagrant::Environment.new begin # Begin logging early here - env.logger.info "`vagrant` invoked: #{ARGV.inspect}" + env.logger.info("vagrant") { "`vagrant` invoked: #{ARGV.inspect}" } # Disable color if the proper argument was passed shell = ARGV.include?("--no-color") ? Thor::Shell::Basic.new : Thor::Base.shell.new diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index 053cf8d4a..2e4b6cc4e 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -81,10 +81,10 @@ module Vagrant @loaded = false @lock_acquired = false - logger.info "Environment initialized (#{self})" - logger.info " - cwd: #{cwd}" - logger.info " - parent: #{parent}" - logger.info " - vm: #{vm}" + logger.info("environment") { "Environment initialized (#{self})" } + logger.info("environment") { " - cwd: #{cwd}" } + logger.info("environment") { " - parent: #{parent}" } + logger.info("environment") { " - vm: #{vm}" } end #--------------------------------------------------------------- @@ -107,14 +107,14 @@ module Vagrant return @_home_path if defined?(@_home_path) @_home_path ||= Pathname.new(File.expand_path(ENV["VAGRANT_HOME"] || DEFAULT_HOME)) - logger.info "Home path: #{@_home_path}" + logger.info("environment") { "Home path: #{@_home_path}" } # This is the old default that Vagrant used to be put things into # up until Vagrant 0.8.0. We keep around an automatic migration # script here in case any old users upgrade. old_home = File.expand_path("~/.vagrant") if File.exists?(old_home) && File.directory?(old_home) - logger.info "Found both an old and new Vagrantfile. Migration initiated." + logger.info("environment") { "Found both an old and new Vagrantfile. Migration initiated." } # We can't migrate if the home directory already exists if File.exists?(@_home_path) @@ -404,11 +404,11 @@ module Vagrant if !parent # We only need to check the virtualbox version once, so do it on # the parent most environment and then forget about it - logger.info "Environment not loaded. Checking virtual box version..." + logger.info("environment") { "Environment not loaded. Checking virtual box version..." } self.class.check_virtualbox! end - logger.info "Loading configuration..." + logger.info("environment") { "Loading configuration..." } load_config! end diff --git a/lib/vagrant/ui.rb b/lib/vagrant/ui.rb index bbca04db8..b62b0089e 100644 --- a/lib/vagrant/ui.rb +++ b/lib/vagrant/ui.rb @@ -12,7 +12,7 @@ module Vagrant [:warn, :error, :info, :confirm].each do |method| define_method(method) do |message| # Log normal console messages - env.logger.info(message) + env.logger.info("ui") { message } end end