Make log4r a first class dependency as we start to switch to it

This commit is contained in:
Mitchell Hashimoto 2011-11-27 18:18:51 -07:00
parent 282bf37350
commit 0a47c9d6fa
2 changed files with 6 additions and 3 deletions

View File

@ -1,3 +1,5 @@
require "log4r"
module Vagrant module Vagrant
module UI module UI
# Vagrant UIs handle communication with the outside world (typically # Vagrant UIs handle communication with the outside world (typically
@ -12,12 +14,13 @@ module Vagrant
def initialize(env) def initialize(env)
@env = env @env = env
@logger = Log4r::Logger.new("vagrant::ui::interface")
end end
[:warn, :error, :info, :success].each do |method| [:warn, :error, :info, :success].each do |method|
define_method(method) do |message, *opts| define_method(method) do |message, *opts|
# Log normal console messages # Log normal console messages
env.logger.info("ui") { message } @logger.info { "#{method}: #{message}" }
end end
end end

View File

@ -17,6 +17,7 @@ Gem::Specification.new do |s|
s.add_dependency "archive-tar-minitar", "= 0.5.2" s.add_dependency "archive-tar-minitar", "= 0.5.2"
s.add_dependency "erubis", "~> 2.7.0" s.add_dependency "erubis", "~> 2.7.0"
s.add_dependency "json", "~> 1.5.1" s.add_dependency "json", "~> 1.5.1"
s.add_dependency "log4r", "~> 1.1.9"
s.add_dependency "net-ssh", "~> 2.1.4" s.add_dependency "net-ssh", "~> 2.1.4"
s.add_dependency "net-scp", "~> 1.0.4" s.add_dependency "net-scp", "~> 1.0.4"
s.add_dependency "i18n", "~> 0.6.0" s.add_dependency "i18n", "~> 0.6.0"
@ -25,7 +26,6 @@ Gem::Specification.new do |s|
s.add_development_dependency "rake" s.add_development_dependency "rake"
s.add_development_dependency "contest", ">= 0.1.2" s.add_development_dependency "contest", ">= 0.1.2"
s.add_development_dependency "log4r", "~> 1.1.9"
s.add_development_dependency "minitest", "~> 2.5.1" s.add_development_dependency "minitest", "~> 2.5.1"
s.add_development_dependency "mocha" s.add_development_dependency "mocha"
s.add_development_dependency "childprocess", "~> 0.2.3" s.add_development_dependency "childprocess", "~> 0.2.3"