Sha256: 797522fcce5b8adc061aaa5237fdc6ce7220f081d6c5bea9ed0ed0a963dbc13c

Contents?: true

Size: 683 Bytes

Versions: 1

Compression:

Stored size: 683 Bytes

Contents

require 'logging'

module Onceover::Logger
  def logger
    unless $logger
      # here we setup a color scheme called 'bright'
      Logging.color_scheme(
        'bright',
        :levels => {
          :debug => :cyan,
          :info => :green,
          :warn => :yellow,
          :error => :red,
          :fatal => [:white, :on_red]
        }
      )

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

      $logger = Logging.logger['Colors']
      $logger.add_appenders 'stdout'
      $logger.level = :info
    end
    $logger
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
onceover-4.0.0 lib/onceover/logger.rb