From c638df9dcb0ac208adf32ce90fe6dbf30e1fa914 Mon Sep 17 00:00:00 2001 From: Teemu Matilainen Date: Thu, 9 Jan 2014 00:53:39 -0300 Subject: [PATCH] core: Tweak host/guest capability logging - Use downcase logger name as everywhere else - Remove duplicate logging from the Guest --- lib/vagrant/capability_host.rb | 5 +++-- lib/vagrant/guest.rb | 3 --- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/vagrant/capability_host.rb b/lib/vagrant/capability_host.rb index af2bc771a..6c2161f7e 100644 --- a/lib/vagrant/capability_host.rb +++ b/lib/vagrant/capability_host.rb @@ -25,7 +25,8 @@ module Vagrant # is a hash where the key is the name of the capability and the value # is the class/module implementing it. def initialize_capabilities!(host, hosts, capabilities, *args) - @cap_logger = Log4r::Logger.new("vagrant::capability_host::#{self.class}") + @cap_logger = Log4r::Logger.new( + "vagrant::capability_host::#{self.class.to_s.downcase}") if host && !hosts[host] raise Errors::CapabilityHostExplicitNotDetected, value: host.to_s @@ -113,7 +114,7 @@ module Vagrant protected def autodetect_capability_host(hosts, *args) - @cap_logger.info("Autodetecting guest for machine: #{@machine}") + @cap_logger.info("Autodetecting host type for #{args.inspect}") # Get the mapping of hosts with the most parents. We start searching # with the hosts with the most parents first. diff --git a/lib/vagrant/guest.rb b/lib/vagrant/guest.rb index f7be29ba1..1265e65dc 100644 --- a/lib/vagrant/guest.rb +++ b/lib/vagrant/guest.rb @@ -22,7 +22,6 @@ module Vagrant include CapabilityHost def initialize(machine, guests, capabilities) - @logger = Log4r::Logger.new("vagrant::guest") @capabilities = capabilities @guests = guests @machine = machine @@ -31,8 +30,6 @@ module Vagrant # This will detect the proper guest OS for the machine and set up # the class to actually execute capabilities. def detect! - @logger.info("Detect guest for machine: #{@machine}") - guest_name = @machine.config.vm.guest initialize_capabilities!(guest_name, @guests, @capabilities, @machine) end