module Rollout::Logging

Public Class Methods

extended(rollout) click to toggle source
# File lib/rollout/logging.rb, line 3
def self.extended(rollout)
  options = rollout.options[:logging]
  options = options.is_a?(Hash) ? options.dup : {}
  options[:storage] ||= rollout.storage

  logger = Logger.new(**options)

  rollout.add_observer(logger, :log)
  rollout.define_singleton_method(:logging) do
    logger
  end
end