Better logging in the BoxAdd action
This commit is contained in:
parent
36cdced052
commit
050cb482f3
|
@ -1,3 +1,5 @@
|
||||||
|
require "log4r"
|
||||||
|
|
||||||
require "vagrant/util/platform"
|
require "vagrant/util/platform"
|
||||||
|
|
||||||
module Vagrant
|
module Vagrant
|
||||||
|
@ -8,6 +10,7 @@ module Vagrant
|
||||||
class BoxAdd
|
class BoxAdd
|
||||||
def initialize(app, env)
|
def initialize(app, env)
|
||||||
@app = app
|
@app = app
|
||||||
|
@logger = Log4r::Logger.new("vagrant::action::builtin::box_add")
|
||||||
end
|
end
|
||||||
|
|
||||||
def call(env)
|
def call(env)
|
||||||
|
@ -20,6 +23,7 @@ module Vagrant
|
||||||
# path as an instance variable so that the `#recover` method can
|
# path as an instance variable so that the `#recover` method can
|
||||||
# access it.
|
# access it.
|
||||||
@temp_path = env[:tmp_path].join("box" + Time.now.to_i.to_s)
|
@temp_path = env[:tmp_path].join("box" + Time.now.to_i.to_s)
|
||||||
|
@logger.info("Downloading box to: #{@temp_path}")
|
||||||
File.open(@temp_path, Vagrant::Util::Platform.tar_file_options) do |f|
|
File.open(@temp_path, Vagrant::Util::Platform.tar_file_options) do |f|
|
||||||
downloader.download!(env[:box_url], f)
|
downloader.download!(env[:box_url], f)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue