module Nuggets::LogParser::Rails

Constants

ITEMS

Log line patterns

PREFIX_RE

Log line prefix

SEPARATOR_RE

Log entry separator

Public Instance Methods

parse_line(line, entry = {}) { || ... } click to toggle source
# File lib/nuggets/log_parser/rails.rb, line 200
def parse_line(line, entry = {})
  ITEMS.each { |key, item|
    if md = item[:re].match(line)
      if key == :processing
        yield if block_given?
        entry[:pid], entry[:host] = md[1], md[2]
      end

      item[:proc][entry, md]

      break
    end
  }

  entry
end