Sha256: 07564562a55c77694b6e413bdf79161c9c5cb16a7e77b241fac0c4d2080b0dc8

Contents?: true

Size: 621 Bytes

Versions: 6

Compression:

Stored size: 621 Bytes

Contents

module Shog
  module Formatters

    # Provide common default log formatting options.
    module Defaults
      module_function

      # @see Shog::Formatter#configure
      # @see Shog::Formatter#with
      def configure( formatter )
        formatter.configure do
          severity_tag( :debug ) { |msg| msg.black.bold }
          severity_tag( :warn  ) { |msg| msg.yellow }
          severity_tag( :error ) { |msg| msg.red }
          severity_tag( :fatal ) { |msg| msg.white_on_red }

          severity( :error ){ |msg| msg.red }
          severity( :fatal ){ |msg| msg.red }
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
shog-0.1.5 lib/shog/formatters/defaults.rb
shog-0.1.4 lib/shog/formatters/defaults.rb
shog-0.1.3 lib/shog/formatters/defaults.rb
shog-0.1.2 lib/shog/formatters/defaults.rb
shog-0.1.1 lib/shog/formatters/defaults.rb
shog-0.1.0 lib/shog/formatters/defaults.rb