Module: WSDL::Log

Included in:
HTTPAdapter, Parser::Importer, Schema::Definition, XML::ElementBuilder
Defined in:
lib/wsdl/log.rb

Overview

Logging facade that provides a per-class logger to any object.

Include this module to get an instance-level #logger method, and a class-level logger method via +extend+.

Both loggers delegate to logger, which defaults to a silent NullLogger. Assign any +Logger+-compatible object to change the output destination:

WSDL.logger = Rails.logger

Examples:

Instance logging

class MyService
  include WSDL::Log

  def call
    logger.info('processing request')
  end
end

Class-level logging

class MyParser
  include WSDL::Log

  def self.parse(xml)
    logger.debug('parsing started')
  end
end

Defined Under Namespace

Modules: ClassMethods Classes: NullLogger

Instance Method Summary collapse

Instance Method Details

#loggerLogger, NullLogger

Returns the logger assigned to WSDL.logger.

Returns:



57
58
59
# File 'lib/wsdl/log.rb', line 57

def logger
  WSDL.logger
end