Sha256: 7255d1203721c6f4df5b5855597c8c4707833c482ee3f0a588545ed1109e4bc1

Contents?: true

Size: 351 Bytes

Versions: 11

Compression:

Stored size: 351 Bytes

Contents

module Chillout
  class PrefixedLogger
    attr_reader :prefix

    def initialize(prefix, logger)
      @prefix = prefix
      @logger = logger
    end

    [:error, :fatal, :warn, :info, :debug].each do |method_name|
      define_method method_name do |message|
        @logger.send(method_name, "[Chillout] #{message}")
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
chillout-0.5.3 lib/chillout/prefixed_logger.rb
chillout-0.5.2 lib/chillout/prefixed_logger.rb
chillout-0.5.1 lib/chillout/prefixed_logger.rb
chillout-0.5.0 lib/chillout/prefixed_logger.rb
chillout-0.4.1 lib/chillout/prefixed_logger.rb
chillout-0.4.0 lib/chillout/prefixed_logger.rb
chillout-0.3.0 lib/chillout/prefixed_logger.rb
chillout-0.2.3 lib/chillout/prefixed_logger.rb
chillout-0.2.2 lib/chillout/prefixed_logger.rb
chillout-0.2.1 lib/chillout/prefixed_logger.rb
chillout-0.2.0 lib/chillout/prefixed_logger.rb