Sha256: a938c64f846958f4638a0ef878ebb623c45aca35b12b0a0819a5367534e2656f

Contents?: true

Size: 507 Bytes

Versions: 26

Compression:

Stored size: 507 Bytes

Contents

module SemanticLogger
  module Formatters
    # Only output one line for each log entry.
    #
    # Notes:
    # * New lines are stripped from log messages.
    # * Exceptions only include the class and message, the stack trace is not shown.
    class OneLine < Default
      def message
        "-- #{log.message.delete("\n")}" if log.message
      end

      def exception
        "-- Exception: #{log.exception.class}: #{log.exception.message.delete("\n")}" if log.exception
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
semantic_logger-4.16.1 lib/semantic_logger/formatters/one_line.rb
semantic_logger-4.16.0 lib/semantic_logger/formatters/one_line.rb
semantic_logger-4.15.0 lib/semantic_logger/formatters/one_line.rb
semantic_logger-4.14.0 lib/semantic_logger/formatters/one_line.rb
semantic_logger-4.13.0 lib/semantic_logger/formatters/one_line.rb
semantic_logger-4.12.0 lib/semantic_logger/formatters/one_line.rb
semantic_logger-4.11.0 lib/semantic_logger/formatters/one_line.rb
semantic_logger-4.10.0 lib/semantic_logger/formatters/one_line.rb
semantic_logger-4.9.0 lib/semantic_logger/formatters/one_line.rb
semantic_logger-4.8.2 lib/semantic_logger/formatters/one_line.rb
semantic_logger-4.8.1 lib/semantic_logger/formatters/one_line.rb
semantic_logger-4.8.0 lib/semantic_logger/formatters/one_line.rb
semantic_logger-4.7.4 lib/semantic_logger/formatters/one_line.rb
semantic_logger-4.7.3 lib/semantic_logger/formatters/one_line.rb
semantic_logger-4.7.2 lib/semantic_logger/formatters/one_line.rb
semantic_logger-4.7.1 lib/semantic_logger/formatters/one_line.rb
semantic_logger-4.7.0 lib/semantic_logger/formatters/one_line.rb
semantic_logger-4.6.1 lib/semantic_logger/formatters/one_line.rb
semantic_logger-4.6.0 lib/semantic_logger/formatters/one_line.rb
semantic_logger-4.6.0.beta1 lib/semantic_logger/formatters/one_line.rb