require 'core/devops-logger'
require 'core/devops-config'

module Devops

  class SidekiqApplication < Application

    def prepare
      require "sidekiq/web"
    end

    def routes
      config = DevopsConfig.config
      log_file = File.join(config[:log_dir], "devops-sidekiq-web.log")
      logger = DevopsLogger.create(log_file, Logger::INFO)
      Sidekiq::Web.use Rack::CommonLogger, logger
      Devops::Routes.route "/sidekiq", Sidekiq::Web
    end

  end
end

