Class: VagrantPlugins::Sakura::Plugin

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-sakura/plugin.rb

Class Method Summary collapse

Class Method Details

.setup_i18nObject



31
32
33
34
# File 'lib/vagrant-sakura/plugin.rb', line 31

def self.setup_i18n
  I18n.load_path << File.expand_path("locales/en.yml", Sakura.source_root)
  I18n.reload!
end

.setup_loggingObject



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/vagrant-sakura/plugin.rb', line 36

def self.setup_logging
  level = nil
  begin
    level = Log4r.const_get(ENV["VAGRANT_LOG"].upcase)
    level = nil if !level.is_a?(Integer)
  rescue NameError
  end

  if level
    logger = Log4r::Logger.new("vagrant_sakura")
    logger.outputters = Log4r::Outputter.stderr
    logger.level = level
    logger = nil
  end
end