Module: ApiAdaptor

Defined in:
lib/api_adaptor/null_logger.rb,
lib/api_adaptor.rb,
lib/api_adaptor/base.rb,
lib/api_adaptor/headers.rb,
lib/api_adaptor/version.rb,
lib/api_adaptor/response.rb,
lib/api_adaptor/variables.rb,
lib/api_adaptor/exceptions.rb,
lib/api_adaptor/json_client.rb,
lib/api_adaptor/list_response.rb

Overview

Null logger class. This is essentially the same as sending data down the ‘/dev/null` black hole.

Examples:

Basic Usage


logger = NullLogger.new
Rails.logger = logger

Basic Pattern Usage

class SomeService
  def initialize(options = {})
    @logger = options[:logger] || NullLogger.new
  end

  def perform
    @logger.debug -> { "do some work here" }
    # .. ..
    @logger.info -> { "finished working" }
  end
end

service = SomeService.new(logger: Logger.new(STDOUT))
service.perform

silent = SomeService.new(logger: NullLogger.new
silent.perform

Defined Under Namespace

Modules: ExceptionHandling, Variables Classes: Base, BaseError, EndpointNotFound, Error, HTTPBadGateway, HTTPBadRequest, HTTPClientError, HTTPConflict, HTTPErrorResponse, HTTPForbidden, HTTPGatewayTimeout, HTTPGone, HTTPIntermittentClientError, HTTPIntermittentServerError, HTTPInternalServerError, HTTPNotFound, HTTPPayloadTooLarge, HTTPServerError, HTTPTooManyRequests, HTTPUnauthorized, HTTPUnavailable, HTTPUnprocessableEntity, Headers, InvalidUrl, JsonClient, ListResponse, NullLogger, Response, SocketErrorException, TimedOutException

Constant Summary collapse

VERSION =
"0.0.2"