Class: Browserlog::LogsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/browserlog/logs_controller.rb

Instance Method Summary collapse

Instance Method Details

#changesObject



13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/browserlog/logs_controller.rb', line 13

def changes
  lines, last_line_number = reader.read(offset: params[:currentLine].to_i)

  respond_to do |format|
    format.json do
      render json: {
        lines: lines.map! { |line| colorizer.colorize_line(line) } ,
        last_line_number: last_line_number
      }
    end
  end
end

#indexObject



8
9
10
11
# File 'app/controllers/browserlog/logs_controller.rb', line 8

def index
  @filename = "#{params[:env]}.log"
  @filepath = Rails.root.join("log/#{@filename}")
end