From 504b709f2daa957b36183aac646d9fea487f0a9a Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 20 May 2010 20:44:58 -0700 Subject: [PATCH] Provisioners use new logger on environment --- lib/vagrant/commands/up.rb | 4 ++-- lib/vagrant/provisioners/base.rb | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/vagrant/commands/up.rb b/lib/vagrant/commands/up.rb index 41336ece7..b71cf95fd 100644 --- a/lib/vagrant/commands/up.rb +++ b/lib/vagrant/commands/up.rb @@ -26,12 +26,12 @@ module Vagrant end if vm.created? - logger.info "VM '#{name}' already created. Booting if its not already running..." + vm.env.logger.info "VM '#{name}' already created. Booting if its not already running..." vm.start else vm.env.require_box - logger.info "Creating VM '#{name}'" + vm.env.logger.info "Creating VM '#{name}'" vm.up end end diff --git a/lib/vagrant/provisioners/base.rb b/lib/vagrant/provisioners/base.rb index 79b675576..f393e2152 100644 --- a/lib/vagrant/provisioners/base.rb +++ b/lib/vagrant/provisioners/base.rb @@ -22,6 +22,12 @@ module Vagrant @vm.env end + # This method returns the environment's logger as a convenience + # method. + def logger + env.logger + end + # This is the method called to "prepare" the provisioner. This is called # before any actions are run by the action runner (see {Vagrant::Actions::Runner}). # This can be used to setup shared folders, forward ports, etc. Whatever is @@ -34,4 +40,4 @@ module Vagrant def provision!; end end end -end \ No newline at end of file +end