Sha256: d2d27986c89f3d6210caa3e4509bdd21ac30deccd693640480090c0ebfc46826

Contents?: true

Size: 690 Bytes

Versions: 13

Compression:

Stored size: 690 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

13 entries across 13 versions & 1 rubygems

Version Path
onceover-3.22.0 lib/onceover/logger.rb
onceover-3.21.0 lib/onceover/logger.rb
onceover-3.20.0 lib/onceover/logger.rb
onceover-3.19.2 lib/onceover/logger.rb
onceover-3.19.1 lib/onceover/logger.rb
onceover-3.19.0 lib/onceover/logger.rb
onceover-3.18.1 lib/onceover/logger.rb
onceover-3.18.0 lib/onceover/logger.rb
onceover-3.17.3 lib/onceover/logger.rb
onceover-3.17.2 lib/onceover/logger.rb
onceover-3.17.1 lib/onceover/logger.rb
onceover-3.17.0 lib/onceover/logger.rb
onceover-3.16.0 lib/onceover/logger.rb