Skip to content

Commit

Permalink
Fixes #11294: Prevent top level constant warning from Logging.
Browse files Browse the repository at this point in the history
The warning "warning: toplevel constant Logging referenced by
Katello::Foreman::Logging" appears many times throughout test runs.
  • Loading branch information
ehelms committed Aug 5, 2015
1 parent 39646f8 commit 20c9d8e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Expand Up @@ -418,7 +418,7 @@ def system_params
end

def logger
Foreman::Logging.logger('katello/cp_proxy')
::Foreman::Logging.logger('katello/cp_proxy')
end

def respond_for_index(options = {})
Expand Down
6 changes: 3 additions & 3 deletions app/lib/katello/resources/candlepin.rb
Expand Up @@ -6,7 +6,7 @@ module Resources
module Candlepin
class Proxy
def self.logger
Foreman::Logging.logger('katello/cp_proxy')
::Foreman::Logging.logger('katello/cp_proxy')
end

def self.post(path, body)
Expand Down Expand Up @@ -50,7 +50,7 @@ class CandlepinResource < HttpResource
self.ca_cert_file = cfg.ca_cert_file

def self.logger
Foreman::Logging.logger('katello/cp_rest')
::Foreman::Logging.logger('katello/cp_rest')
end

def self.default_headers(uuid = nil)
Expand Down Expand Up @@ -284,7 +284,7 @@ def update_content_override(id, content_label, name, value = nil)

class UpstreamConsumer < HttpResource
def self.logger
Foreman::Logging.logger('katello/cp_rest')
::Foreman::Logging.logger('katello/cp_rest')
end

def self.resource(url, client_cert, client_key, ca_file)
Expand Down
2 changes: 1 addition & 1 deletion app/models/katello/glue.rb
Expand Up @@ -2,7 +2,7 @@ module Katello
module Glue
singleton_class.send :attr_writer, :logger
def self.logger
@logger ||= Foreman::Logging.logger('katello/glue')
@logger ||= ::Foreman::Logging.logger('katello/glue')
end

def self.included(base)
Expand Down
2 changes: 1 addition & 1 deletion app/models/katello/glue/provider.rb
Expand Up @@ -198,7 +198,7 @@ def owner_imports
end

def import_logger
Foreman::Logging.logger('katello/manifest_import_logger')
::Foreman::Logging.logger('katello/manifest_import_logger')
end

# TODO: break up method
Expand Down
2 changes: 1 addition & 1 deletion lib/katello/engine.rb
Expand Up @@ -148,7 +148,7 @@ class Engine < ::Rails::Engine
require 'katello/permissions'

Tire::Configuration.url(Katello.config.elastic_url)
bridge = Katello::TireBridge.new(Foreman::Logging.logger('katello/tire_rest'))
bridge = Katello::TireBridge.new(::Foreman::Logging.logger('katello/tire_rest'))
Tire.configure { logger bridge, :level => bridge.level }
end

Expand Down

0 comments on commit 20c9d8e

Please sign in to comment.