Sha256: 85103989571c57e12fff534b99ad4ea71a71672138b295d08413e364966a9b3d

Contents?: true

Size: 455 Bytes

Versions: 23

Compression:

Stored size: 455 Bytes

Contents

# frozen_string_literal: true

module KnapsackPro
  class LoggerWrapper
    def initialize(logger)
      @logger = logger
    end

    private

    attr_reader :logger

    LOG_LEVEL_METHODS = KnapsackPro::Config::Env::LOG_LEVELS.keys.map(&:to_sym)

    def method_missing(method, *args, &block)
      if LOG_LEVEL_METHODS.include?(method)
        args[0] = "[knapsack_pro] #{args[0]}"
      end
      logger.send(method, *args, &block)
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
knapsack_pro-6.0.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-5.7.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-5.6.0 lib/knapsack_pro/logger_wrapper.rb