Sha256: 0076c88804e077fe84c2734983bd173c5ab0f9b70b3f6d469c1d304e3bafe056

Contents?: true

Size: 620 Bytes

Versions: 2

Compression:

Stored size: 620 Bytes

Contents

# frozen_string_literal: true

module VidazingLogger
  # Determines the format for the logger messages
  #
  # @api private
  # @since 0.2.0
  class LayoutPattern
    attr_reader :layout

    def initialize(color_scheme_name)
      @layout = LayoutPattern.basic.dup
      @layout[:color_scheme] = color_scheme_name
    end

    class << self
      def colored(color_scheme_name)
        LayoutPattern.new(color_scheme_name)
      end

      def basic
        {
          pattern: '[%d] %-5l %c: %m\n',
          # ISO8601 without the 'T'
          date_pattern: '%Y-%m-%d %H:%M:%S'
        }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vidazing_logger-0.2.1 lib/vidazing_logger/layout_pattern.rb
vidazing_logger-0.2.0 lib/vidazing_logger/layout_pattern.rb