Sha256: c4b13a6d04c2f62b35e388dd7377702ed55c7a0ab55e8ff873858099304c216d

Contents?: true

Size: 579 Bytes

Versions: 39

Compression:

Stored size: 579 Bytes

Contents

# encoding: UTF-8
module ForestLiana
  class Logger
    class << self
      def log
        logger = ::Logger.new(STDOUT)
        logger_colors = {
          DEBUG: 34,
          WARN: 33,
          ERROR: 31,
          INFO: 37
        }

        logger.formatter = proc do |severity, datetime, progname, message|
          displayed_message = "[#{datetime.to_s(:db)}] Forest 🌳🌳🌳  #{message}\n"
          "\e[#{logger_colors[severity.to_sym]}m#{displayed_message}\033[0m"
        end

        logger
      end
    end
  end
end

FOREST_LOGGER = ForestLiana::Logger.log

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
forest_liana-1.6.10 config/initializers/logger.rb
forest_liana-1.6.7 config/initializers/logger.rb
forest_liana-1.6.6 config/initializers/logger.rb
forest_liana-1.6.5 config/initializers/logger.rb
forest_liana-1.6.4 config/initializers/logger.rb
forest_liana-1.6.3 config/initializers/logger.rb
forest_liana-1.6.2 config/initializers/logger.rb
forest_liana-1.6.1 config/initializers/logger.rb
forest_liana-1.6.0 config/initializers/logger.rb
forest_liana-1.5.26 config/initializers/logger.rb
forest_liana-1.5.25 config/initializers/logger.rb
forest_liana-1.5.24 config/initializers/logger.rb
forest_liana-1.5.23 config/initializers/logger.rb
forest_liana-1.5.22 config/initializers/logger.rb
forest_liana-1.5.21 config/initializers/logger.rb
forest_liana-1.5.20 config/initializers/logger.rb
forest_liana-1.5.19 config/initializers/logger.rb
forest_liana-1.5.18 config/initializers/logger.rb
forest_liana-1.5.17 config/initializers/logger.rb
forest_liana-1.5.16 config/initializers/logger.rb