Sha256: 88ba355062d96a573435240d0860a71cc9cfadb38a87a28ebe071ceb2700659b

Contents?: true

Size: 730 Bytes

Versions: 8

Compression:

Stored size: 730 Bytes

Contents

module RequestLogAnalyzer::Aggregator

  # Echo Aggregator. Writes everything to the screen when it is passed to this aggregator
  class Echo < Base

    attr_accessor :warnings

    def prepare
      @warnings = []
    end

    # Display every parsed line immediately to the terminal
    def aggregate(request)
      puts "\nRequest: " + request.lines.inspect
    end

    # Capture all warnings during parsing
    def warning(type, message, lineno)
      @warnings << "WARNING #{type.inspect} on line #{lineno}: #{message}"
    end

    # Display every warning in the report when finished parsing
    def report(output)
      output.title("Warnings during parsing")
      @warnings.each { |w| output.puts(w) }
    end

  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
request-log-analyzer-1.5.2 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.5.1 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.5.0 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.4.2 lib/request_log_analyzer/aggregator/echo.rb
ngmoco-request-log-analyzer-1.4.2 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.4.1 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.4.0.1 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.4.0 lib/request_log_analyzer/aggregator/echo.rb