Sha256: 287580ed78ab3906becfe7a6d06b0ca22be3033a8396de15a5ac4d2933c73076

Contents?: true

Size: 831 Bytes

Versions: 11

Compression:

Stored size: 831 Bytes

Contents

require 'logging'

module Blazing
  module Logger

    # include Logging.globally

    # here we setup a color scheme called 'bright'
    Logging.color_scheme( 'bright',
      :levels => {
        :debug => :green,
        :info  => :green,
        :warn  => :yellow,
        :error => [:white, :on_red],
        :fatal => [:white, :on_red]
      }
    )

    Logging.appenders.stdout(
      'stdout',
      :layout => Logging.layouts.pattern(
        :pattern => ' ------> [blazing] %-5l: %m\n',
        :color_scheme => 'bright'
      )
    )

    Logging.logger.root.appenders = 'stdout'
    Logging.logger.root.level = :info
    Logging.consolidate :root

    %w[debug info warn error fatal].each do |level|
      define_method level do |message|
        Logging.logger[self].send(level, message)
      end
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
blazing-0.4.2 lib/blazing/logger.rb
blazing-0.4.1 lib/blazing/logger.rb
blazing-0.4.0 lib/blazing/logger.rb
blazing-0.4.0.beta3 lib/blazing/logger.rb
blazing-0.4.0.beta2 lib/blazing/logger.rb
blazing-0.4.0.beta1 lib/blazing/logger.rb
blazing-0.3.0 lib/blazing/logger.rb
blazing-0.2.14 lib/blazing/logger.rb
blazing-0.2.13 lib/blazing/logger.rb
blazing-0.2.12 lib/blazing/logger.rb
blazing-0.2.11 lib/blazing/logger.rb