Sha256: d2da7e1e76b890011c6fd442262143d1225d78f5f8473b3b35b575884c252990

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

require "log4r"
require "log4r/outputter/deployment_tracker_outputter"

module Vagrant
  module UI
    class Interface
      attr_reader :logger
    end
  end
end

module VagrantPlugins
  module ManagedServers
    module Action
      class InitDeploymentTracker
        def initialize(app, _env)
          @app    = app
          @logger = Log4r::Logger.new("vagrant_managed_servers::action::init_deployment_tracker")
        end

        def call(env)
          host = env[:tracker_host]
          return unless host
          SwaggerClient::Swagger.configure do |config|
            config.host = host
          end
          ui = env[:ui]
          unless ui.logger.outputters.collect(&:name).include?("deployment-tracker")
            # Make sure that we've hooked the global ui logger as well. We should
            # see if we can do this earlier in the process to capture more of the output
            ui.logger.add Log4r::DeploymentTrackerOutputter.new("deployment-tracker")
          end
          @app.call(env)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vagrant-orchestrate-0.7.0.pre.4 lib/vagrant-managed-servers/action/init_deployment_tracker.rb
vagrant-orchestrate-0.7.0.pre.3 lib/vagrant-managed-servers/action/init_deployment_tracker.rb
vagrant-orchestrate-0.7.0.pre.2 lib/vagrant-managed-servers/action/init_deployment_tracker.rb