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-5.5.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-5.4.1 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-5.4.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-5.3.5 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-5.3.4 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-5.3.3 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-5.3.2 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-5.3.1 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-5.3.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-5.2.1 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-5.2.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-5.1.2 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-5.1.1 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-5.1.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-5.0.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-4.1.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-4.0.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-3.11.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-3.10.0 lib/knapsack_pro/logger_wrapper.rb
knapsack_pro-3.9.0 lib/knapsack_pro/logger_wrapper.rb