Method: LogParser::Message#to_s
- Defined in:
- lib/log_parser/message.rb
#to_s ⇒ String
Convert this message to a file-line string representation.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/log_parser/message.rb', line 44 def to_s lines = if @source_lines.nil? '' else # @type [Hash<Symbol, Int>] @source_lines ":#{@source_lines.values.uniq.join('-')}" end = @message = .split("\n").map(&:strip).join(' ') unless @preformatted += "\nLog pattern: '#{@pattern}'" if Logger.debug? <<~MSG #{@source_file}#{lines}: #{@level.to_s.upcase} #{} MSG end |