Sha256: 5d868309f27a40e3c174f4cc0368f64256065460ea72361d2a3a068faec5f721

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.2.1 lib/shog/formatters/defaults.rb
shog-0.2.0 lib/shog/formatters/defaults.rb
shog-0.1.9 lib/shog/formatters/defaults.rb
shog-0.1.8 lib/shog/formatters/defaults.rb
shog-0.1.7 lib/shog/formatters/defaults.rb
shog-0.1.6 lib/shog/formatters/defaults.rb