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-7.13.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-7.12.1 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-7.12.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-7.11.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-7.10.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-7.9.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-7.8.2 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-7.8.1 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-7.8.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-7.7.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-7.6.2 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-7.6.1 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-7.6.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-7.1.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-7.0.1 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-7.0.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-6.0.4 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-6.0.3 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-6.0.2 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-6.0.1 lib/knapsack_pro/logger_wrapper.rb