Sha256: 275536645f4ef098efe67a56aa90e7bd259845e8b2834c8fd02c14ab47828b9a

Contents?: true

Size: 424 Bytes

Versions: 95

Compression:

Stored size: 424 Bytes

Contents

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

95 entries across 95 versions & 1 rubygems

Version Path
knapsack_pro-1.11.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-1.10.1 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-1.10.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-1.9.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-1.8.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-1.7.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-1.6.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-1.5.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-1.4.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-1.3.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-1.2.1 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-1.2.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-1.1.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-1.0.2 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-1.0.1 lib/knapsack_pro/logger_wrapper.rb